XanaduAI / strawberryfields

Strawberry Fields is a full-stack Python library for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits.
https://strawberryfields.ai
Apache License 2.0
747 stars 186 forks source link

numpy>=1.19.2 as requirement #581

Closed antalszava closed 3 years ago

antalszava commented 3 years ago

Context

The new release of TensorFlow version 2.5 pins numpy ~= 1.19.2. As Strawberry Fields pins numpy>=1.20, installing SF in a clean environment results in version conflicts between TensorFlow's and SF's numpy version requirement.

Changes

Pins numpy>=1.19.2 in requirements.txt, doc/requirements.txt and setup.py.

Related issues

Closes #580.

codecov[bot] commented 3 years ago

Codecov Report

Merging #581 (ef5fab7) into master (39b0265) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #581   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files          75       75           
  Lines        8414     8414           
=======================================
  Hits         8278     8278           
  Misses        136      136           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 39b0265...ef5fab7. Read the comment docs.

antalszava commented 3 years ago

Hi @josh146, thanks for the comments! I'll merge this but can ease the numpy version if we'd like.

Not entirely sure why prior to this PR there's a difference of:

josh146 commented 3 years ago

Not entirely sure why prior to this PR there's a difference of:

Yes, good point. Ideally, requirements.txt should be pinning exactly, and requirements-ci.txt should match as closely as possible our setup.py.

antalszava commented 3 years ago

Ohh okay! So maybe reverting to setup.py: numpy>=1.17.4 and noting to have a requirements-ci.txt could work?

Also, I was wondering, how come we don't have tensorflow as a requirement in setup.py? :thinking:

josh146 commented 3 years ago

Also, I was wondering, how come we don't have tensorflow as a requirement in setup.py? 🤔

To avoid it being a hard requirement for users that want to install SF but not TF :)

antalszava commented 3 years ago

Oh right! The thing that confused me and which caused the initial issue is that we have it in requirements.txt. If we have a requirements-ci.txt, would we like to remove TF from requirements.txt?

josh146 commented 3 years ago

If we have a requirements-ci.txt, would we like to remove TF from requirements.txt?

Good question, I would say probably not. Let's have requirements.txt be the full environment required to use all SF features