You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should not happen, instead either attempting to load should trigger a clear NotImplementedError, or perhaps in this case xarray's assert functions should dispatch to virtualizarr's equals method instead of trying to coerce to a numpy array.
deftest_lithops(self, netcdf4_files_factory):
# by default this will use the lithops LocalHost executorfilepath1, filepath2=netcdf4_files_factory()
# test combine nested without in-memory indexescombined_vds=open_virtual_mfdataset(
[filepath1, filepath2],
combine="nested",
concat_dim="time",
coords="minimal",
compat="override",
indexes={},
parallel="lithops",
)
vds1=open_virtual_dataset(filepath1, indexes={})
vds2=open_virtual_dataset(filepath2, indexes={})
expected_vds=xr.concat(
[vds1, vds2], dim="time", coords="minimal", compat="override"
)
>xrt.assert_identical(combined_vds.coords['lat'], expected_vds.coords['lat'])
virtualizarr/tests/test_backend.py:508:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/Users/tom/miniconda3/envs/numpy2.0_released/lib/python3.11/site-packages/xarray/core/formatting.py:973: indiff_array_reprtemp= [wrap_indent(short_array_repr(obj), start=" ") forobjin (a, b)]
/Users/tom/miniconda3/envs/numpy2.0_released/lib/python3.11/site-packages/xarray/core/formatting.py:973: in<listcomp>temp= [wrap_indent(short_array_repr(obj), start=" ") forobjin (a, b)]
/Users/tom/miniconda3/envs/numpy2.0_released/lib/python3.11/site-packages/xarray/core/formatting.py:634: inshort_array_reprarray=to_duck_array(array)
/Users/tom/miniconda3/envs/numpy2.0_released/lib/python3.11/site-packages/xarray/namedarray/pycompat.py:129: into_duck_arraychunkmanager=get_chunked_array_type(data)
__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args= (ManifestArray<shape=(25,), dtype=float32, chunks=(25,)>,), chunked_arrays= [ManifestArray<shape=(25,), dtype=float32, chunks=(25,)>]
chunked_array_types= {<class'virtualizarr.manifests.array.ManifestArray'>}
chunkmanagers= {'cubed': <cubed_xarray.cubedmanager.CubedManagerobjectat0x12db73450>, 'dask': <xarray.namedarray.daskmanager.DaskManagerobjectat0x12cc32990>}
defget_chunked_array_type(*args: Any) ->ChunkManagerEntrypoint[Any]:
""" Detects which parallel backend should be used for given set of arrays. Also checks that all arrays are of same chunking type (i.e. not a mix of cubed and dask). """# TODO this list is probably redundant with something inside xarray.apply_ufuncALLOWED_NON_CHUNKED_TYPES= {int, float, np.ndarray}
chunked_arrays= [
aforainargsifis_chunked_array(a) andtype(a) notinALLOWED_NON_CHUNKED_TYPES
]
# Asserts all arrays are the same type (or numpy etc.)chunked_array_types= {type(a) forainchunked_arrays}
iflen(chunked_array_types) >1:
raiseTypeError(
f"Mixing chunked array types is not supported, but received multiple types: {chunked_array_types}"
)
eliflen(chunked_array_types) ==0:
raiseTypeError("Expected a chunked array but none were found")
# iterate over defined chunk managers, seeing if each recognises this array typechunked_arr=chunked_arrays[0]
chunkmanagers=list_chunkmanagers()
selected= [
chunkmanagerforchunkmanagerinchunkmanagers.values()
ifchunkmanager.is_chunked_array(chunked_arr)
]
ifnotselected:
>raiseTypeError(
f"Could not find a Chunk Manager which recognises type {type(chunked_arr)}"ETypeError: CouldnotfindaChunkManagerwhichrecognises type <class'virtualizarr.manifests.array.ManifestArray'>
The text was updated successfully, but these errors were encountered:
This should not happen, instead either attempting to load should trigger a clear
NotImplementedError
, or perhaps in this case xarray's assert functions should dispatch to virtualizarr's equals method instead of trying to coerce to a numpy array.The text was updated successfully, but these errors were encountered: