-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue where
weights
were not correctly added to ds
If the grids of `weights` and `ds` were close but not equal (floating point errors), then `weights` is not correctly added to `ds`, causing `weights` to be entirely 0s. This has been fixed by explicitly setting the weights grid to the ds grid if their grids are `np.allclose()`. Warnings have been added if the resultant homogenized `weights` array is all nans or all 0s. `xa.normalize()` has been updated to ensure that if all the input vector is 0, then an output vector of all nans is returned. New tests of `xa.normalize()` have been added to ensure it is more robust in the future. Small fixes (changes of "|" and "&" to "or" and "and" in if statements, mainly)
- Loading branch information
Showing
6 changed files
with
73 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0075c7e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes #57