Skip to content

Numpy > 1.20#2739

Merged
j9ac9k merged 3 commits intopyqtgraph:masterfrom
MalteOlle:numpy-2
Jun 3, 2023
Merged

Numpy > 1.20#2739
j9ac9k merged 3 commits intopyqtgraph:masterfrom
MalteOlle:numpy-2

Conversation

@MalteOlle
Copy link
Copy Markdown
Contributor

Calling pg.functions.colorDistance([]) raises an error when using numpy >= 1.20, because np.float is deprecated, see https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations.

Other Tasks

Bump Dependency Versions

Files that need updates

Confirm the following files have been either updated or there has been a determination that no update is needed.

  • README.md
  • setup.py
  • tox.ini
  • .github/workflows/main.yml and associated requirements.txt and conda environemt.yml files
  • pyproject.toml
  • binder/requirements.txt
Pre-Release Checklist

Pre Release Checklist

  • Update version info in __init__.py
  • Update CHANGELOG primarily using contents from automated changelog generation in GitHub release page
  • Have git tag in the format of pyqtgraph-
Post-Release Checklist

Steps To Complete

  • Append .dev0 to __version__ in __init__.py
  • Announce on mail list
  • Announce on Twitter

@MalteOlle MalteOlle changed the title Numpy 2 Numpy > 1.20 Jun 3, 2023
@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Jun 3, 2023

Whoops, nice catch on the use of the deprecated API. We should add a test to cover that codepath, but that's outside the scope of this PR.

Why is the test being removed? Also, nice library, thanks for adding to the README!

@MalteOlle
Copy link
Copy Markdown
Contributor Author

MalteOlle commented Jun 3, 2023

Whoops, nice catch on the use of the deprecated API. We should add a test to cover that codepath, but that's outside the scope of this PR.

Why is the test being removed? Also, nice library, thanks for adding to the README!

Ah I just removed a test which I had added in the previous commit, but which did not turn out to really test the issue I thought (wanted to test colorDistance by creating a colormap with linearize=True, but wasn't able to get to the colorDistance function this way).

So in the end, I simply added a "stupid" test, that just checks whether colorDistance returns without raising am error If number of colors is 0 and 2.

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Jun 3, 2023

Whops, should have noticed that :D Thanks for the PR!

@j9ac9k j9ac9k merged commit 8da2bd8 into pyqtgraph:master Jun 3, 2023
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.

Use of deprecated np.float results in crash when calling pg.functions.colorDistance([])

3 participants