-
-
Notifications
You must be signed in to change notification settings - Fork 406
enh: Update norm function in transform.py #6366
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
Conversation
added default behaviour when values to normalize are all equal; if they are all 0 then all values are set to 0, otherwise all values are set to 1
Can you explain why this is needed? |
Sure ! I ran into this error because I'm working on xarray datasets with multiple variables and procedurally creating vectorfields for each variable. I'm controlling the scale of the vectors using .opts(magnitude=hv.dim("Magnitude").norm()) |
I'm not opposed to this PR, but currently, it breaks CI. Did you try to pass in limits to Would you happen to have a small example I could play around with? |
Co-authored-by: Philipp Rudiger <prudiger@anaconda.com>
Thank you for the PR, this will be part of the next release 1.21.0 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6366 +/- ##
==========================================
+ Coverage 88.83% 88.84% +0.01%
==========================================
Files 328 328
Lines 69805 69829 +24
==========================================
+ Hits 62010 62039 +29
+ Misses 7795 7790 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
New feature / Bug Fix
Added default behaviour when values to normalize are all equal; previously holoviews would attempt division by zero and return a runtime warning.
Proposed change : if all values are equal to zero, set all values to 0; otherwise, set all values to 1.