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

Add explicit numpy dependency #286

Merged
merged 2 commits into from
Jun 25, 2023
Merged

Add explicit numpy dependency #286

merged 2 commits into from
Jun 25, 2023

Conversation

garrison
Copy link
Member

@garrison garrison commented Jun 23, 2023

We are currently relying on numpy being installed as a transitive dependency (through, at the very least, Qiskit Terra). Even better would be to specific it explicitly, and to set the minimum version following #70 (comment).

TODO

  • add a release note

@garrison garrison added the dependencies Pull requests that update a dependency file label Jun 23, 2023
@github-actions
Copy link

github-actions bot commented Jun 23, 2023

Pull Request Test Coverage Report for Build 5356659197

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.919%

Totals Coverage Status
Change from base Build 5348348321: 0.0%
Covered Lines: 2337
Relevant Lines: 2599

💛 - Coveralls

@garrison garrison marked this pull request as ready for review June 23, 2023 13:04
@caleb-johnson
Copy link
Collaborator

Isn't leaving it unpinned a little more robust since we don't rely on any unstable numpy features?

@garrison
Copy link
Member Author

Isn't leaving it unpinned a little more robust since we don't rely on any unstable numpy features?

What do you mean by "more robust"?

I'll say a few things, though.

  1. We should specify numpy as dependency since we import it directly. We should not rely on it being transitively depended on by Qiskit, even though there is no real risk of that changing.
  2. Since we depend on it, it'd be nice to pin the minimum version to something sensible. Qiskit Terra depends on numpy>=1.17, so we could follow suit and do the same.
  3. We know that the performance degrades on numpy versions earlier than 1.23 -- at least, if one uses CutQC to reconstruct the full probability distribution. I considered adding a warning, but it seems unlikely that everyone would notice it. I could think of no harm to bumping the minimum version of numpy to 1.23, so that's what I did here.

@caleb-johnson
Copy link
Collaborator

caleb-johnson commented Jun 24, 2023

  1. We should specify numpy as dependency since we import it directly. We should not rely on it being transitively depended on by Qiskit, even though there is no real risk of that changing.
  2. We know that the performance degrades on numpy versions earlier than 1.23 -- at least, if one uses CutQC to reconstruct the full probability distribution. I considered adding a warning, but it seems unlikely that everyone would notice it. I could think of no harm to bumping the minimum version of numpy to 1.23, so that's what I did here.

Thanks, I like the justification of "we import it directly, so it is our dependency".

I agree, let's pin minimum to 1.23

Copy link
Collaborator

@caleb-johnson caleb-johnson left a comment

Choose a reason for hiding this comment

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

LGTM 👍 thanks!

@garrison garrison merged commit 0f08ee8 into main Jun 25, 2023
@garrison garrison deleted the explicit-numpy-dependency branch June 25, 2023 02:19
caleb-johnson pushed a commit that referenced this pull request Jul 5, 2023
* Add explicit numpy dependency

* Add release note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants