Skip to content

Error when accessing MRI-ESM2-0  #560

@axelschweiger

Description

@axelschweiger

Here's a quick checklist in what to include:

  • Include a detailed description of the bug or suggestion

  • Output of intake_esm.show_versions()

  • Minimal, self-contained copy-pastable example that generates the issue if possible. Please be concise with code posted. See guidelines below on how to provide a good bug report:

Description

I'm trying to access some CMIP6 data using intake-esm with below code.
Running this generates the following error. I'm new to intake so I have no clue what's going on here. Something about mixed time objections. Any pointers greatly appreciated.

Traceback

The keys in the returned dictionary of datasets are constructed as follows:
	'activity_id.institution_id.source_id.experiment_id.table_id.grid_label'
/home/axel/ax_python_lib/CMIP6/intake_debug.py:24: DeprecationWarning: cdf_kwargs and zarr_kwargs are deprecated and will be removed in a future version. Please use xarray_open_kwargs instead.
  dset_dict = cat.to_dataset_dict(zarr_kwargs={'consolidated': True})
Traceback (most recent call last):
  File ~/anaconda3/envs/pangeo310/lib/python3.10/site-packages/intake_esm/source.py:258 in _open_dataset
    self._ds = xr.combine_by_coords(
  File ~/anaconda3/envs/pangeo310/lib/python3.10/site-packages/xarray/core/combine.py:982 in combine_by_coords
    concatenated = _combine_single_variable_hypercube(
  File ~/anaconda3/envs/pangeo310/lib/python3.10/site-packages/xarray/core/combine.py:629 in _combine_single_variable_hypercube
    combined_ids, concat_dims = _infer_concat_order_from_coords(list(datasets))
  File ~/anaconda3/envs/pangeo310/lib/python3.10/site-packages/xarray/core/combine.py:131 in _infer_concat_order_from_coords
    _ensure_same_types(series, dim)
  File ~/anaconda3/envs/pangeo310/lib/python3.10/site-packages/xarray/core/combine.py:78 in _ensure_same_types
    raise TypeError(error_msg)
TypeError: Cannot combine along dimension 'time' with mixed types. Found: DatetimeProlepticGregorian, Timestamp. If importing data directly from a file then setting `use_cftime=True` may fix this issue.
Traceback (most recent call last):
  File ~/anaconda3/envs/pangeo310/lib/python3.10/site-packages/spyder_kernels/py3compat.py:356 in compat_exec
    exec(code, globals, locals)
  File ~/ax_python_lib/CMIP6/intake_debug.py:24
    dset_dict = cat.to_dataset_dict(zarr_kwargs={'consolidated': True})
  File pydantic/decorator.py:40 in pydantic.decorator.validate_arguments.validate.wrapper_function
  File pydantic/decorator.py:134 in pydantic.decorator.ValidatedFunction.call
  File pydantic/decorator.py:206 in pydantic.decorator.ValidatedFunction.execute
  File ~/anaconda3/envs/pangeo310/lib/python3.10/site-packages/intake_esm/core.py:651 in to_dataset_dict
    raise exc
  File ~/anaconda3/envs/pangeo310/lib/python3.10/site-packages/intake_esm/core.py:647 in to_dataset_dict
    key, ds = task.result()
  File ~/anaconda3/envs/pangeo310/lib/python3.10/concurrent/futures/_base.py:451 in result
    return self.__get_result()
  File ~/anaconda3/envs/pangeo310/lib/python3.10/concurrent/futures/_base.py:403 in __get_result
    raise self._exception
  File ~/anaconda3/envs/pangeo310/lib/python3.10/concurrent/futures/thread.py:58 in run
    result = self.fn(*self.args, **self.kwargs)
  File ~/anaconda3/envs/pangeo310/lib/python3.10/site-packages/intake_esm/core.py:789 in _load_source
    return key, source.to_dask()
  File ~/anaconda3/envs/pangeo310/lib/python3.10/site-packages/intake_esm/source.py:273 in to_dask
    self._load_metadata()
  File ~/anaconda3/envs/pangeo310/lib/python3.10/site-packages/intake/source/base.py:285 in _load_metadata
    self._schema = self._get_schema()
  File ~/anaconda3/envs/pangeo310/lib/python3.10/site-packages/intake_esm/source.py:205 in _get_schema
    self._open_dataset()
  File ~/anaconda3/envs/pangeo310/lib/python3.10/site-packages/intake_esm/source.py:265 in _open_dataset
    raise ESMDataSourceError(
ESMDataSourceError: Failed to load dataset with key='ScenarioMIP.MRI.MRI-ESM2-0.ssp585.SImon.gn'
                 You can use `cat['ScenarioMIP.MRI.MRI-ESM2-0.ssp585.SImon.gn'].df` to inspect the assets/files for this key.

What I Did

rom matplotlib import pyplot as plt
import numpy as np
import pandas as pd
import xarray as xr
import intake
import fsspec
import dask

cat_url = "https://storage.googleapis.com/cmip6/pangeo-cmip6.json"
col = intake.open_esm_datastore(cat_url)

cat = col.search(experiment_id=['historical', 'ssp585'], table_id='SImon', variable_id='sisnthick',
                 grid_label='gn',source_id='MRI-ESM2-0')
#                 grid_label='gn',source_id='CNRM-CM6-1-HR')
dset_dict = cat.to_dataset_dict(zarr_kwargs={'consolidated': True})

Version information: output of intake_esm.show_versions()

Details

INSTALLED VERSIONS

cftime: 1.6.2
dask: 2022.12.1
fastprogress: 1.0.3
fsspec: 2022.11.0
gcsfs: 2022.11.0
intake: 0.6.6
intake_esm: 2022.9.18
netCDF4: 1.6.2
pandas: 1.5.2
requests: 2.28.1
s3fs: 2022.11.0
xarray: 2022.12.0
zarr: 2.13.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions