-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
recent versions of sparse and dask seem to be incompatible with our tests #5654
Comments
this seems to be caused by changes to either |
This is showing up in the normal CI now, see |
This looks like dask. __________________________________ test_chunk __________________________________
@requires_dask
def test_chunk():
s = sparse.COO.from_numpy(np.array([0, 0, 1, 2]))
a = DataArray(s)
ac = a.chunk(2)
assert ac.chunks == ((2, 2),)
assert isinstance(ac.data._meta, sparse.COO)
> assert_identical(ac, a)
self = <COO: shape=(2,), dtype=bool, nnz=0, fill_value=False>
other = <function _broadcast_trick_inner at 0x7f325aef91f0>
def func(self, other):
if _disables_array_ufunc(other):
return NotImplemented
> return ufunc(other, self)
E TypeError: operand type(s) all returned NotImplemented from __array_ufunc__(<ufunc 'bitwise_and'>, '__call__', <function _broadcast_trick_inner at 0x7f325aef91f0>, <COO: shape=(2,), dtype=bool, nnz=0, fill_value=False>): 'curry', 'COO' cc @jrbourbeau |
Thanks for the ping @dcherian. Running against Dask's Since |
We already require
|
Ah, that's a good point @keewis. Stepping back a bit, my current situation locally is I'm able to reproduce the
Rolling EDIT: I should note that the |
Would double check that CI is pulling the latest xref: dask/dask#7939 (comment) |
Good point. CI is currently pulling in the latest It also appears there were some ordering concerns related to dask/dask#5259 when |
FWIW, the upstream-dev CI installs |
Yeah was just mentioning that since we had older version of |
Also cc @crusaderky if you get a chance to look into this |
I'm a bit lost. The ongoing failures in upstream-dev:
Aren't in any way related to either sparse or dask; they appear when I upgrade matplotlib from 3.4.3 to 3.5.0b1. |
It was xfailed in #5729 , maybe that explains it |
I see now. I got really confused by the matplotlib issue which is what the opening post of this ticket is about. Would it be possible to have the two issues tracked by separate tickets? |
definitely, let's keep this one focused on |
Narrowed it down. >>> import dask.array as da
>>> import sparse
>>> s = sparse.COO.from_numpy([0, 0, 1, 2])
>>> a = da.from_array(s)
>>> z = da.zeros_like(a)
>>> z
dask.array<zeros_like, shape=(4,), dtype=int64, chunksize=(4,), chunktype=sparse.COO>
>>> z.compute()
<function _broadcast_trick_inner at 0x7fb8a3874e50> numpy-1.20.1 |
The problem is that sparse.zeros_like does not accept the shape= optional parameter, which is new in numpy 1.17. This is where it gets triggered: I don't think dask should write a workaround to this, and it should be just fixed upstream? CC @jrbourbeau for opinion. |
Hrm, looking at the API docs for In [1]: import sparse
In [2]: sparse.__version__
Out[2]: '0.12.0'
In [3]: import numpy as np
In [4]: x = np.arange(6)
In [5]: y = sparse.zeros_like(x, shape=(3, 2))
In [6]: y
Out[6]: <COO: shape=(3, 2), dtype=int64, nnz=0, fill_value=0>
In [7]: y.todense()
Out[7]:
array([[0, 0],
[0, 0],
[0, 0]]) |
Ah, shape= was very recently added in 0.12.0. It wasn't there in 0.11.2. [EDIT] It is not the only problem. Investigating further. |
The second issue is that |
Third and final issue is when
|
cc @pentschev (just so you are aware) |
Thanks for hunting all this down @crusaderky, I'm currently grokking it. Also cc @hameerabbasi for visibility |
This seems like a genuine bug, please file it on our tracker if possible. |
I have fixed the reported issues and released version 0.13.0 with the fixes included. |
Thanks Hameer! 😄 |
Thank you guys for the amazing investigation into the issues here. 🤗 I was basically pinpointed at the issues from my point of view. |
This should be closed via #5751. Again, thanks all for your efforts! |
Workflow Run URL
Python 3.9 Test Summary Info
The text was updated successfully, but these errors were encountered: