Skip to content

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

Open
@OndraM

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions