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

Addressed future warnings regarding dataset.dims #984

Merged
merged 6 commits into from
May 23, 2024

Conversation

clarasb
Copy link
Collaborator

@clarasb clarasb commented May 21, 2024

Closes #981

Checklist:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/source/*
  • Changes documented in CHANGES.md
  • GitHub CI passes
  • AppVeyor CI passes
  • Test coverage remains or increases (target 100%)

@clarasb clarasb self-assigned this May 21, 2024
@clarasb clarasb requested review from forman, TonioF and pont-us May 21, 2024 16:19
@clarasb clarasb marked this pull request as ready for review May 21, 2024 16:20
Copy link
Member

@forman forman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, all good!

Copy link
Member

@pont-us pont-us left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine and works fine! Looks as though it's just in time too.

Just as a note: a few of the dims -> sizes substitutions here were not really necessary. For example in iproc.py:

        if "time" in dataset.dims:

The impending xarray change won't remove dims, but will change the functionality from returning a dimension->size mapping to a set of dimensions. So tests with the in operator will continue to work.

However, there's also no harm in changing to sizes, since with dicts in checks membership of the set of keys, so the functionality in this case is identical. So this is just an incidental comment rather than a change request :).

@forman
Copy link
Member

forman commented May 22, 2024

Just as a note: a few of the dims -> sizes substitutions here were not really necessary.

@pont-us please feel free to prepare a related PR for your requested changes. It would be much appreciated. This was however not in the scope of @clarasb's PR.

@forman forman removed the request for review from TonioF May 22, 2024 12:45
@clarasb clarasb merged commit 88bd621 into main May 23, 2024
4 checks passed
@clarasb clarasb deleted the clarasb-981-FutureWarnings_dataset_dims branch May 23, 2024 07:27
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.

FutureWarnings: return type of Dataset.dims
3 participants