BUG: Add object cast to avoid warning with limited API#26995
Merged
Conversation
To be honest, I think we should just delete this from the public API. But I thought I'll start with this, since at least in principle that isn't a bug-release thing to backport. I am not sure setting warnings to errors is wise (at least for Cython and MSVC). OTOH, the Cython module currently truly does nothing except include the headers (it doesn't even use the NumPy `.pyd` yet).
This was referenced Oct 4, 2024
joeycarter
added a commit
to PennyLaneAI/catalyst
that referenced
this pull request
Oct 7, 2024
**Context:** Catalyst currently contains the NumPy requirement `numpy==2.0` in several places (e.g. `requirements.txt`) and `numpy<=2.0` in `setup.py`. If a version of NumPy more recent than 2.0.0 is already installed by `pip`, these requirements force Catalyst to use NumPy 2.0.0. However, NumPy 2.0.0 contains a bug that's blocking the use of the numpy C API with the Stable ABI in Catalyst. This bug was fixed in NumPy 2.0.1: numpy/numpy#26995 (the original issue was written up here: numpy/numpy#26756). Changing the NumPy requirement to `numpy!=2.0.0` ensures that we avoid the problematic NumPy version, which is necessary as we replace pybind11 with nanobind in Catalyst to use the Stable ABI. Moreover, it also explicitly allows Catalyst to be installed with more recent versions of NumPy. Note that other packages on which Catalyst depends may impose implicit requirements on the version of NumPy used, e.g. PennyLane currently requires `numpy<2.1`. **Description of the Change:** Changes NumPy requirement to `numpy!=2.0.0`. Also updates the PennyLane dependency to `pennylane==0.39.0.dev30` to capture PennyLaneAI/pennylane#6342, which resolves related NumPy-dependency conflicts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #26985.
To be honest, I think we should just delete this from the public API. But I thought I'll start with this, since at least in principle that isn't a bug-release thing to backport.
I am not sure setting warnings to errors is wise (at least for Cython and MSVC). OTOH, the Cython module currently truly does nothing except include the headers (it doesn't even use the NumPy
.pydyet).Closes gh-26756