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

Add "nvertices" to renaming dict #357

Merged
merged 3 commits into from
Jun 25, 2024
Merged

Add "nvertices" to renaming dict #357

merged 3 commits into from
Jun 25, 2024

Conversation

jbusecke
Copy link
Owner

@jbusecke jbusecke commented Jun 25, 2024

  • Passes pre-commit run --all-files
  • User visible changes (including notable bug fixes) are documented in whats-new.rst

@jbusecke
Copy link
Owner Author

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?

@jbusecke jbusecke merged commit 5ef581f into main Jun 25, 2024
7 of 8 checks passed
@jbusecke jbusecke deleted the renaming-nvertices branch June 25, 2024 03:54
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

Successfully merging this pull request may close these issues.

1 participant