Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

querying.getvar doesn't accept chunks='auto' kwarg #333

Open
anton-seaice opened this issue Oct 24, 2023 · 1 comment
Open

querying.getvar doesn't accept chunks='auto' kwarg #333

anton-seaice opened this issue Oct 24, 2023 · 1 comment
Labels

Comments

@anton-seaice
Copy link

When I run :

cc.querying.getvar(
  '1deg_jra55_iaf_omip2_cycle6', 
  variable='sea_level', 
  session=session, 
  frequency='1 monthly', 
  start_time='2000-01', end_time='2001-12', 
  chunks='auto'
)

I get this error:

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-23.07/lib/python3.10/site-packages/cosima_cookbook/querying.py:385, in getvar(expt, variable, session, ncfile, start_time, end_time, n, frequency, attrs, attrs_unique, return_dataset, **kwargs)
    383 chunks = xr_kwargs.get("chunks", None)
    384 if chunks is not None:
--> 385     missing_chunk_dims = set(chunks.keys()) - set(da.dims)
    386     if len(missing_chunk_dims) > 0:
    387         logging.warning(
    388             f"chunking along dimensions {missing_chunk_dims} is not possible. Available dimensions for chunking are {set(da.dims)}"
    389         )

AttributeError: 'str' object has no attribute 'keys'

However, chunks='auto' should be a valid key word argument to be passed to xr.open_mfdataset().

@anton-seaice
Copy link
Author

Per COSIMA/cosima-recipes#305, it may be better to remove all chunking done by the cookbook, and use the xarray defaults (which are good now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants