Skip to content

Commit

Permalink
add test vs kerchunk inlining
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNicholas committed Apr 5, 2024
1 parent 6fef91c commit d27ba38
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions virtualizarr/tests/test_integration.py
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

0 comments on commit d27ba38

Please sign in to comment.