Closed gjoseph92 closed 3 years ago
Thanks so much for this @gjoseph92! Sorry we missed your suggestion. #49 got a bit hard to follow by the end.
Merging #61 (b20c3f9) into master (d1df004) will decrease coverage by
0.06%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #61 +/- ##
==========================================
- Coverage 84.14% 84.08% -0.07%
==========================================
Files 2 2
Lines 246 245 -1
Branches 77 74 -3
==========================================
- Hits 207 206 -1
Misses 34 34
Partials 5 5
Impacted Files | Coverage Δ | |
---|---|---|
xhistogram/core.py | 81.72% <100.00%> (-0.10%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update fe1b3fa...b20c3f9. Read the comment docs.
Thanks @gjoseph92 for catching this!
The PR looks good to me, but there some test failures on some environments (all with python 3.7 it seems) of a form where
all_arrays = broadcast_arrays(*all_arrays)
is somehow causing
def raise_if_computed():
> raise ValueError("Triggered forbidden computation")
E ValueError: Triggered forbidden computation
xhistogram\test\fixtures.py:8: ValueError
there are some test failures
Attempting to reproduce locally (on Ubuntu) suggests that a more recent numpy version will pass on python 3.7, so perhaps any future release of this functionality should just bump the dependencies a bit?
Thanks for looking into that. Yes, this will require NumPy >= 0.17 so that NEP-18 is active by default. I've updated that in this PR. Incidentally I saw that the NumPy version used in CI is different for all three Python versions; is that intentional?
I saw that the NumPy version used in CI is different for all three Python versions; is that intentional?
Yes, that's so we can provide some CI coverage over multiple versions of NumPy (we do something similar in dask/dask
)
I noticed that #49 introduced a regression where input arrays now all must be the same shape (before, they'd be broadcast when possible). In https://github.com/xgcm/xhistogram/pull/49#discussion_r640872588 I was trying to explain this and a potential fix, but probably wasn't very clear about it.
Here's a test demonstrating the issue; this passes on
HEAD^
(as long as dask is installed from main). I'll push up the rest of the fix in a few hours.cc @TomNicholas @rabernat