Skip to content
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

Numpy 1.24.0 incompatibility - TypeError: ufunc 'isfinite' not supported #57

Open
OndraM opened this issue Dec 19, 2022 · 0 comments
Open

Comments

@OndraM
Copy link

OndraM commented Dec 19, 2022

Hi, there seems to be an incompatibility with yesterday released numpy 1.24.0.

$ pip install graph-cli
(...)
Installing collected packages: pytz, six, pyparsing, pillow, packaging, numpy, kiwisolver, fonttools, cycler, python-dateutil, contourpy, pandas, matplotlib, graph-cli
Successfully installed contourpy-1.0.6 cycler-0.11.0 fonttools-4.38.0 graph-cli-0.1.19 kiwisolver-1.4.4 matplotlib-3.6.2 numpy-1.24.0 packaging-22.0 pandas-1.5.2 pillow-9.3.0 pyparsing-3.0.9 python-dateutil-2.8.2 pytz-2022.7 six-1.16.0
$ graph data.csv (...)

Traceback (most recent call last):
 File "/opt/hostedtoolcache/Python/3.11.1/x64/bin/graph", line 8, in <module>
   sys.exit(main.main())
            ^^^^^^^^^^^
 File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/graph_cli/main.py", line 17, in main
   create_graph(graphs)
 File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/graph_cli/graph.py", line 317, in create_graph
   ax.fill_between(graph.xcol, graph.ycol, alpha=0.1,
 File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/matplotlib/__init__.py", line 1423, in inner
   return func(ax, *map(sanitize_sequence, args), **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/matplotlib/axes/_axes.py", line 5367, in fill_between
   return self._fill_between_x_or_y(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/matplotlib/axes/_axes.py", line 5272, in _fill_between_x_or_y
   ind, dep1, dep2 = map(
   ^^^^^^^^^^^^^^^
 File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/numpy/ma/core.py", line 2360, in masked_invalid
   return masked_where(~(np.isfinite(getdata(a))), a, copy=copy)
                         ^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

Workaround is locking to previous numpy version, for example:

pip install graph-cli numpy==1.23.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant