Skip to content

Fix tox config, bump min numpy to 1.22#2755

Merged
j9ac9k merged 5 commits intopyqtgraph:masterfrom
j9ac9k:fix-tox-config
Jun 26, 2023
Merged

Fix tox config, bump min numpy to 1.22#2755
j9ac9k merged 5 commits intopyqtgraph:masterfrom
j9ac9k:fix-tox-config

Conversation

@j9ac9k
Copy link
Copy Markdown
Member

@j9ac9k j9ac9k commented Jun 25, 2023

PR addresses 3 issues

  • Fix tox.ini to run only on compatible configurations
  • Remove usage of numpy.product which is deprecated as of NumPy 1.25 and will be removed in NumPy 2.0
  • Bump minimum NumPy from 1.21 to 1.22 per NEP-29 timeline

@j9ac9k
Copy link
Copy Markdown
Member Author

j9ac9k commented Jun 25, 2023

Computer says no...

@j9ac9k
Copy link
Copy Markdown
Member Author

j9ac9k commented Jun 25, 2023

Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
  File "/Users/ogi/Developer/pyqtgraph/pyqtgraph/examples/BarGraphItem.py", line 17, in <module>
    bg1 = pg.BarGraphItem(x=x, height=y1, width=0.3, brush='r')
  File "/Users/ogi/Developer/pyqtgraph/pyqtgraph/graphicsItems/BarGraphItem.py", line 62, in __init__
    self.setOpts(**opts)
  File "/Users/ogi/Developer/pyqtgraph/pyqtgraph/graphicsItems/BarGraphItem.py", line 68, in setOpts
    self._prepareData()
  File "/Users/ogi/Developer/pyqtgraph/pyqtgraph/graphicsItems/BarGraphItem.py", line 198, in _prepareData
    memory = self._rectarray.ndarray()
  File "/Users/ogi/Developer/pyqtgraph/pyqtgraph/Qt/internals.py", line 185, in ndarray
    nd = np.frombuffer(mv, dtype=np.float64, count=self._size*self._nfields)
BufferError: format has not been specified

I can replicate the locally, only occurs on NumPy 1.22.x 1.22.4, not 1.23.x or <= 1.22.3.

@pijyoi
Copy link
Copy Markdown
Contributor

pijyoi commented Jun 25, 2023

This workaround for np.clip on Windows (or rather MSVC) can also be removed.
https://github.com/pyqtgraph/pyqtgraph/blob/master/pyqtgraph/functions.py#L1215-L1219

@j9ac9k j9ac9k force-pushed the fix-tox-config branch 2 times, most recently from 5c931a1 to 0af95d4 Compare June 25, 2023 14:59
@pijyoi
Copy link
Copy Markdown
Contributor

pijyoi commented Jun 26, 2023

Maybe add this link as a comment numpy/numpy#21612

@j9ac9k j9ac9k merged commit c7b0a14 into pyqtgraph:master Jun 26, 2023
@j9ac9k j9ac9k deleted the fix-tox-config branch June 26, 2023 16:53
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

Successfully merging this pull request may close these issues.

2 participants