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
The experiment '01deg_jra55v13_ryf9091' can't currently be converted to an xarray via to_dask. From looking at the Dask dashboard, all of the open_dataset calls complete, but then something crashes out at the concatenation stage.
To Reproduce
In a Jupyter notebook with a few CPUs, run:
importintakecatalog=intake.cat.access_nriimportdaskfromdask.distributedimportClienttry:
print(client)
exceptNameError:
client=Client()
//-------------exp="01deg_jra55v13_ryf9091"ht_search=catalog[exp].search(variable="ht")
ht_search# Shows one dataset from 1116 assets//-------------darray=ht_search.to_dask()
The last cell will fail with the following:
---------------------------------------------------------------------------ValueErrorTraceback (mostrecentcalllast)
File/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/intake_esm/source.py:259, inESMDataSource._open_dataset(self)
255datasets= [
256ds.set_coords(set(ds.variables) -set(ds.attrs[OPTIONS['vars_key']]))
257fordsindatasets258 ]
-->259self._ds=xr.combine_by_coords(datasets, **self.xarray_combine_by_coords_kwargs)
261self._ds.attrs[OPTIONS['dataset_key']] =self.keyFile/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/xarray/core/combine.py:958, incombine_by_coords(data_objects, compat, data_vars, coords, fill_value, join, combine_attrs)
956# Perform the multidimensional combine on each group of data variables957# before merging back together-->958concatenated_grouped_by_data_vars=tuple(
959_combine_single_variable_hypercube(
960tuple(datasets_with_same_vars),
961fill_value=fill_value,
962data_vars=data_vars,
963coords=coords,
964compat=compat,
965join=join,
966combine_attrs=combine_attrs,
967 )
968forvars, datasets_with_same_varsingrouped_by_vars969 )
971returnmerge(
972concatenated_grouped_by_data_vars,
973compat=compat,
(...)
976combine_attrs=combine_attrs,
977 )
File/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/xarray/core/combine.py:959, in<genexpr>(.0)
956# Perform the multidimensional combine on each group of data variables957# before merging back together958concatenated_grouped_by_data_vars=tuple(
-->959_combine_single_variable_hypercube(
960tuple(datasets_with_same_vars),
961fill_value=fill_value,
962data_vars=data_vars,
963coords=coords,
964compat=compat,
965join=join,
966combine_attrs=combine_attrs,
967 )
968forvars, datasets_with_same_varsingrouped_by_vars969 )
971returnmerge(
972concatenated_grouped_by_data_vars,
973compat=compat,
(...)
976combine_attrs=combine_attrs,
977 )
File/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/xarray/core/combine.py:619, in_combine_single_variable_hypercube(datasets, fill_value, data_vars, coords, compat, join, combine_attrs)
614raiseValueError(
615"At least one Dataset is required to resolve variable names "616"for combined hypercube."617 )
-->619combined_ids, concat_dims=_infer_concat_order_from_coords(list(datasets))
621iffill_valueisNone:
622# check that datasets form complete hypercubeFile/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/xarray/core/combine.py:144, in_infer_concat_order_from_coords(datasets)
143iflen(datasets) >1andnotconcat_dims:
-->144raiseValueError(
145"Could not find any dimension coordinates to use to "146"order the datasets for concatenation"147 )
149combined_ids=dict(zip(tile_ids, datasets))
ValueError: CouldnotfindanydimensioncoordinatestousetoorderthedatasetsforconcatenationTheaboveexceptionwasthedirectcauseofthefollowingexception:
ESMDataSourceErrorTraceback (mostrecentcalllast)
CellIn[4], line1---->1darray=ht_search.to_dask()
File/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/intake_esm/core.py:814, inesm_datastore.to_dask(self, **kwargs)
810iflen(self) !=1: # quick check to fail more quickly if there are many results811raiseValueError(
812f'Expected exactly one dataset. Received {len(self)} datasets. Please refine your search or use `.to_dataset_dict()`.'813 )
-->814res=self.to_dataset_dict(**{**kwargs, 'progressbar': False})
815iflen(res) !=1: # extra check in case kwargs did modify something816raiseValueError(
817f'Expected exactly one dataset. Received {len(self)} datasets. Please refine your search or use `.to_dataset_dict()`.'818 )
File/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/pydantic/deprecated/decorator.py:55, invalidate_arguments.<locals>.validate.<locals>.wrapper_function(*args, **kwargs)
53 @wraps(_func)
54defwrapper_function(*args: Any, **kwargs: Any) ->Any:
--->55returnvd.call(*args, **kwargs)
File/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/pydantic/deprecated/decorator.py:150, inValidatedFunction.call(self, *args, **kwargs)
148defcall(self, *args: Any, **kwargs: Any) ->Any:
149m=self.init_model_instance(*args, **kwargs)
-->150returnself.execute(m)
File/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/pydantic/deprecated/decorator.py:222, inValidatedFunction.execute(self, m)
220returnself.raw_function(*args_, **kwargs, **var_kwargs)
221else:
-->222returnself.raw_function(**d, **var_kwargs)
File/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/intake_esm/core.py:686, inesm_datastore.to_dataset_dict(self, xarray_open_kwargs, xarray_combine_by_coords_kwargs, preprocess, storage_options, progressbar, aggregate, skip_on_error, **kwargs)
684exceptExceptionasexc:
685ifnotskip_on_error:
-->686raiseexc687self.datasets=self._create_derived_variables(datasets, skip_on_error)
688returnself.datasetsFile/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/intake_esm/core.py:682, inesm_datastore.to_dataset_dict(self, xarray_open_kwargs, xarray_combine_by_coords_kwargs, preprocess, storage_options, progressbar, aggregate, skip_on_error, **kwargs)
680fortaskingen:
681try:
-->682key, ds=task.result()
683datasets[key] =ds684exceptExceptionasexc:
File/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/concurrent/futures/_base.py:451, inFuture.result(self, timeout)
449raiseCancelledError()
450elifself._state==FINISHED:
-->451returnself.__get_result()
453self._condition.wait(timeout)
455ifself._statein [CANCELLED, CANCELLED_AND_NOTIFIED]:
File/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/concurrent/futures/_base.py:403, inFuture.__get_result(self)
401ifself._exception:
402try:
-->403raiseself._exception404finally:
405# Break a reference cycle with the exception in self._exception406self=NoneFile/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/concurrent/futures/thread.py:58, in_WorkItem.run(self)
55return57try:
--->58result=self.fn(*self.args, **self.kwargs)
59exceptBaseExceptionasexc:
60self.future.set_exception(exc)
File/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/intake_esm/core.py:833, in_load_source(key, source)
832def_load_source(key, source):
-->833returnkey, source.to_dask()
File/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/intake_esm/source.py:272, inESMDataSource.to_dask(self)
270defto_dask(self):
271"""Return xarray object (which will have chunks)"""-->272self._load_metadata()
273returnself._dsFile/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/intake/source/base.py:283, inDataSourceBase._load_metadata(self)
281"""load metadata only if needed"""282ifself._schemaisNone:
-->283self._schema=self._get_schema()
284self.dtype=self._schema.dtype285self.shape=self._schema.shapeFile/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/intake_esm/source.py:208, inESMDataSource._get_schema(self)
206def_get_schema(self) ->Schema:
207ifself._dsisNone:
-->208self._open_dataset()
209metadata= {'dims': {}, 'data_vars': {}, 'coords': ()}
210self._schema=Schema(
211datashape=None,
212dtype=None,
(...)
215extra_metadata=metadata,
216 )
File/g/data/hh5/public/apps/miniconda3/envs/analysis3-24.07/lib/python3.10/site-packages/intake_esm/source.py:264, inESMDataSource._open_dataset(self)
261self._ds.attrs[OPTIONS['dataset_key']] =self.key263exceptExceptionasexc:
-->264raiseESMDataSourceError(
265f"""Failed to load dataset with key='{self.key}' 266 You can use `cat['{self.key}'].df` to inspect the assets/files for this key. 267 """268 ) fromexcESMDataSourceError: Failedtoloaddatasetwithkey='ocean_grid.fx'Youcanuse`cat['ocean_grid.fx'].df`toinspecttheassets/filesforthiskey.
Additional context
I discovered this by accident whilst trying to merge the update version of the COSIMA Recipes example "Cross-contour_transport.ipynb" into the branch that is doing the Intake update of the same recipe: COSIMA/cosima-recipes#356 . The issue doesn't actually affect the example so far, as I can workaround it by querying on a single start_time for the first part of the recipe, and then the time range used in the second part of the recipe doesn't seem to be affected.
The text was updated successfully, but these errors were encountered:
Describe the bug
The experiment '01deg_jra55v13_ryf9091' can't currently be converted to an xarray via
to_dask
. From looking at the Dask dashboard, all of theopen_dataset
calls complete, but then something crashes out at the concatenation stage.To Reproduce
In a Jupyter notebook with a few CPUs, run:
The last cell will fail with the following:
Additional context
I discovered this by accident whilst trying to merge the update version of the COSIMA Recipes example "Cross-contour_transport.ipynb" into the branch that is doing the Intake update of the same recipe: COSIMA/cosima-recipes#356 . The issue doesn't actually affect the example so far, as I can workaround it by querying on a single
start_time
for the first part of the recipe, and then the time range used in the second part of the recipe doesn't seem to be affected.The text was updated successfully, but these errors were encountered: