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

Eliminate dimension renaming warning. #363

Open
jbusecke opened this issue Jun 25, 2024 · 0 comments
Open

Eliminate dimension renaming warning. #363

jbusecke opened this issue Jun 25, 2024 · 0 comments

Comments

@jbusecke
Copy link
Owner

          I am getting a new warnning for this:
from xmip.preprocessing import combined_preprocessing

url = "https://storage.googleapis.com/cmip6/cmip6-pgf-ingestion-test/catalog/catalog.json" 
col = intake.open_esm_datastore(url)
cat_ice = col.search(source_id=source_ids, experiment_id='piControl', table_id='SImon', grid_label='gn', variable_id=['sithick', 'siconc'])
ddict_ice = cat_ice.to_dataset_dict(aggregate=False, preprocess=combined_preprocessing)

gives:

[/srv/conda/envs/notebook/lib/python3.11/site-packages/xmip/preprocessing.py:79](https://leap.2i2c.cloud/srv/conda/envs/notebook/lib/python3.11/site-packages/xmip/preprocessing.py#line=78): UserWarning: rename 'nj' to 'y' does not create an index anymore. Try using swap_dims instead or use set_index after rename to create an indexed coordinate.
  da = da.rename({di: target}).set_xindex(target)
[/srv/conda/envs/notebook/lib/python3.11/site-packages/xmip/preprocessing.py:79](https://leap.2i2c.cloud/srv/conda/envs/notebook/lib/python3.11/site-packages/xmip/preprocessing.py#line=78): UserWarning: rename 'ni' to 'x' does not create an index anymore. Try using swap_dims instead or use set_index after rename to create an indexed coordinate.
  da = da.rename({di: target}).set_xindex(target)
[/srv/conda/envs/notebook/lib/python3.11/site-packages/xmip/preprocessing.py:79](https://leap.2i2c.cloud/srv/conda/envs/notebook/lib/python3.11/site-packages/xmip/preprocessing.py#line=78): UserWarning: rename 'nj' to 'y' does not create an index anymore. Try using swap_dims instead or use set_index after rename to create an indexed coordinate.
  da = da.rename({di: target}).set_xindex(target)
[/srv/conda/envs/notebook/lib/python3.11/site-packages/xmip/preprocessing.py:79](https://leap.2i2c.cloud/srv/conda/envs/notebook/lib/python3.11/site-packages/xmip/preprocessing.py#line=78): UserWarning: rename 'ni' to 'x' does not create an index anymore. Try using swap_dims instead or use set_index after rename to create an indexed coordinate.
  da = da.rename({di: target}).set_xindex(target)

I think this is not bad but might be nice to get rid of this warning by properly using swap dims?

Originally posted by @jbusecke in #357 (comment)

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

No branches or pull requests

1 participant