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 an option in Array.set_labels to ignore missing labels #1090

Open
gdementen opened this issue Oct 23, 2023 · 1 comment
Open

add an option in Array.set_labels to ignore missing labels #1090

gdementen opened this issue Oct 23, 2023 · 1 comment

Comments

@gdementen
Copy link
Contributor

When applying the same map (for example to translate several arrays for final reporting), it is very tedious to have to compute the correct mapping for each array (intersect the global mapping keys with the axis labels).

>>> arr = ndtest(3)
>>> arr.set_labels({'a1': 'A1', 'a3': 'A3'})
ValueError: 'a3' is not a valid label for any axis:
 a [3]: 'a0' 'a1' 'a2'

Since this could hide errors and it sort-of-conflicts with #906, we cannot do this by default. Having an option would be nice though.

@gdementen
Copy link
Contributor Author

FWIW, I needed this for dc2019

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

No branches or pull requests

1 participant