-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6fef91c
commit d27ba38
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from virtualizarr import open_virtual_dataset | ||
|
||
from pprint import pprint | ||
|
||
|
||
def test_numpy_arrays_to_inlined_kerchunk_refs(netcdf4_file): | ||
from kerchunk.hdf import SingleHdf5ToZarr | ||
|
||
# test inlining all the variables | ||
expected = SingleHdf5ToZarr(netcdf4_file, spec=1, inline_threshold=1e9).translate() | ||
|
||
pprint(expected) | ||
|
||
# loading all the variables should produce same result as inlining them all using kerchunk | ||
vds = open_virtual_dataset(netcdf4_file, loadable_variables=['air', 'time', 'lat', 'lon'], indexes={}) | ||
refs = vds.virtualize.to_kerchunk(format='dict') | ||
|
||
assert refs == expected |