-
Notifications
You must be signed in to change notification settings - Fork 5
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
TypeError: ufunc 'isnan' not supported for the input types, #4
Comments
Hi @MIriamastro, thank you for using ndRADEX! I think that the workaround (replacing |
Hi @astropenguin . |
Hi @MIriamastro, thank you for sharing your environment. I found that the TypeError in ndRADEX was caused by a bug of xarray whose version is v0.12.2 or later (released a month ago). This bug changes the dtype of some coordinates, which is an unexpected behavior for ndRADEX.
It seems that the bug will be fixed in the next version of xarray (v0.12.4?), so could you please keep using xarray v0.12.1 or earlier to avoid that behavior until the next xarray is released? |
Hi @MIriamastro, I released ndRADEX v0.2.0, in which I stopped using xarray v0.12.2 or v0.12.3. I hope upgrading ndRADEX (e.g., |
UPDATE: I changed in File
"/home/user/.local/lib/python3.6/site-packages/ndradex/grid.py", line 228,
where is said if np.any(np.isnan(coord)): I wroteif np.any(pd.isnull(coord))
, and seems like it's fixed it.I'm running ndradex, with spyder,
and I get the following error:
`100%|██████████| 1/1 [00:00<00:00, 27.19it/s]
Traceback (most recent call last):
File "", line 1, in
runfile('/media/user/radex/prueba_pyradex.py', wdir='/media/user/radex')
File "/usr/lib/python3/dist-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile
execfile(filename, namespace)
File "/usr/lib/python3/dist-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/media/user/radex/prueba_pyradex.py", line 11, in
ds = nd.run('co', '1-0', 100, 1e15, 1e3)
File "/home/user/.local/lib/python3.6/site-packages/ndradex/utils.py", line 30, in wrapper
return func(*bound.args, **bound.kwargs)
File "/home/user/.local/lib/python3.6/site-packages/ndradex/grid.py", line 169, in run
return finalize(dataset, squeeze)
File "/home/user/.local/lib/python3.6/site-packages/ndradex/grid.py", line 228, in finalize
if np.any(np.isnan(coord)):
File "/home/user/.local/lib/python3.6/site-packages/xarray/core/arithmetic.py", line 69, in array_ufunc
dask='allowed')
File "/home/user/.local/lib/python3.6/site-packages/xarray/core/computation.py", line 969, in apply_ufunc
keep_attrs=keep_attrs)
File "/home/user/.local/lib/python3.6/site-packages/xarray/core/computation.py", line 217, in apply_dataarray_vfunc
result_var = func(*data_vars)
File "/home/user/.local/lib/python3.6/site-packages/xarray/core/computation.py", line 564, in apply_variable_ufunc
result_data = func(*input_data)
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''`
How can I fix this?
The text was updated successfully, but these errors were encountered: