Skip to content

Conversation

@shunt16
Copy link
Collaborator

@shunt16 shunt16 commented Nov 18, 2024

Fixes #21 and #33.

Adds methods (plus tests):

  • obsarray.unc_accessor.UncAccessor.rename
  • obsarray.unc_accessor.UncAccessor.rename_dims

Add function (plus tests):

  • obsarray.utils.append_name

Docs updated according:

  • API docs for above functions
  • Uncertainty interface section on renaming

@shunt16 shunt16 requested a review from pdevis November 18, 2024 14:59
@shunt16 shunt16 self-assigned this Nov 18, 2024
Copy link
Contributor

@pdevis pdevis left a comment

Choose a reason for hiding this comment

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

All looks great!

One suggestion for a useful addition would be a function that renames all the variables containing a specific string to another string. E.g. could be implemented along the lines of:

ds.unc.rename(dict([(key, key.replace("temperature", "temperature2")) for key in ds.variables.keys() if "temperature" in key]))

@shunt16 shunt16 merged commit 4859812 into main Jun 22, 2025
3 of 4 checks passed
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.

Method to safely rename dimensions

3 participants