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

Ensure compatible version of numpy in isolated_notebook_test.py #6038

Merged

Conversation

pavoljuhas
Copy link
Collaborator

Keep numpy version in the isolated Python environment at 1.23 as
numpy-1.24 is incompatible with cirq and numba.

Fixes stuck notebook tests which import numba.

Related to #5967

Keep numpy version in the isolated Python environment at 1.23
as numpy-1.24 is incompatible with cirq and numba.

Fixes stuck notebook tests which import numba.

Related to quantumlib#5967
@pavoljuhas pavoljuhas requested review from a team, vtomole and cduck as code owners March 14, 2023 23:38
@pavoljuhas pavoljuhas requested a review from viathor March 14, 2023 23:38
@pavoljuhas pavoljuhas added kind/health For CI/testing/release process/refactoring/technical debt items area/notebook-testing labels Mar 14, 2023
@pavoljuhas
Copy link
Collaborator Author

ping - can somebody PTAL?

Copy link
Collaborator

@viathor viathor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR LGTM, but as a general reflection: it replicates the constraints in requirements.txt, so I'm wondering whether there is a way to avoid the duplication?

@pavoljuhas
Copy link
Collaborator Author

This PR LGTM, but as a general reflection: it replicates the constraints in requirements.txt, so I'm wondering whether there is a way to avoid the duplication?

Ack. To my understanding this list of packages should simulate the jupyter/colab environment of a user running the examples for the first time. The cirq is installed as a part of the notebook execution in that environment later.
As such the package lists can be different.

BTW, the !pip install cirq in the notebook will cause a numpy downgrade to 1.23 per cirq requirements, but the papermill process which executes the notebook seems to already have numpy-1.24 imported by that point.
The combination of import numpy, numba causes a SystemError with numpy-1.24.

@pavoljuhas pavoljuhas merged commit 2c51eca into quantumlib:master Mar 21, 2023
36 checks passed
@pavoljuhas pavoljuhas deleted the use-numpy-1.23-in-notebook-tests branch March 21, 2023 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/notebook-testing kind/health For CI/testing/release process/refactoring/technical debt items
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants