Obspy: GCF read fails on windows (recent python + numpy 1.22)

Created on 4 Jan 2022  路  5Comments  路  Source: obspy/obspy

https://tests.obspy.org/115141/ & https://tests.obspy.org/115136/ on two independent machines show the error

I suspect it's numpy-dtype related:

Traceback (most recent call last):
File "C:\Miniconda3\envs\test\lib\site-packages\numpy\core\fromnumeric.py", line 57, in _wrapfunc
return bound(*args, **kwds)
TypeError: the resolved dtypes are not compatible with add.accumulate. Resolved (dtype('int32'), dtype('int32'), dtype('int32'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\a\obspy\obspy\obspy\io\gcf\tests\test_core.py", line 72, in test_read_via_module
st = _read_gcf(filename)
File "D:\a\obspy\obspy\obspy\io\gcf\core.py", line 89, in _read_gcf
hd = libgcf.read(f, **kwargs)
File "D:\a\obspy\obspy\obspy\io\gcf\libgcf.py", line 167, in read
return read_data_block(f, headonly=False, **kwargs)
File "D:\a\obspy\obspy\obspy\io\gcf\libgcf.py", line 144, in read_data_block
data = (fic + np.cumsum(data)).astype('i4')
File "<__array_function__ internals>", line 180, in cumsum
File "C:\Miniconda3\envs\test\lib\site-packages\numpy\core\fromnumeric.py", line 2569, in cumsum
return _wrapfunc(a, 'cumsum', axis=axis, dtype=dtype, out=out)
File "C:\Miniconda3\envs\test\lib\site-packages\numpy\core\fromnumeric.py", line 66, in _wrapfunc
return _wrapit(obj, method, *args, **kwds)
File "C:\Miniconda3\envs\test\lib\site-packages\numpy\core\fromnumeric.py", line 43, in _wrapit
result = getattr(asarray(obj), method)(*args, **kwds)
TypeError: the resolved dtypes are not compatible with add.accumulate. Resolved (dtype('int32'), dtype('int32'), dtype('int32'))
bug testing io.gcf

All 5 comments

note to self: temporarily fixed numpy<1.22 for github actions testing!

image
and it's OK like this!

should be solved by https://github.com/numpy/numpy/pull/20722 ; so waiting now that numpy releases 1.22.1 and we can relax the "numpy<1.22" condition

Nominally, the .. versionchanged:: tag says 1.23.0. I'm checking on the PR thread to verify

Looks like it won't be backported. numpy!=1.22 might be a better option.

We don't really need to use NumPy there, I think. See the above PR.

Was this page helpful?
0 / 5 - 0 ratings