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
754 stars 191 forks source link

Moving utility functions to a utils package #413

Closed antalszava closed 4 years ago

antalszava commented 4 years ago

Context: As further additions would extend the utils module (e.g. functions for post-processing of samples) it became desirable to make is a package.

Description of the Change: Creates a new utils package and imports names from the utils module.

Benefits:

Possible Drawbacks: Importing names from utils.py requires managing a long list for __all__. The alternative of resorting to an absolute import would, however, this would both introduce discrepancies in the test suite as well as potentially break user code.

Related GitHub Issues: Related PR: #399

codecov[bot] commented 4 years ago

Codecov Report

Merging #413 into master will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #413   +/-   ##
=======================================
  Coverage   97.84%   97.84%           
=======================================
  Files          59       63    +4     
  Lines        6760     6774   +14     
=======================================
+ Hits         6614     6628   +14     
  Misses        146      146           
Impacted Files Coverage Δ
strawberryfields/utils/__init__.py 100.00% <100.00%> (ø)
strawberryfields/utils/decorators.py 100.00% <100.00%> (ø)
strawberryfields/utils/program_functions.py 97.77% <100.00%> (ø)
strawberryfields/utils/random_numbers_matrices.py 100.00% <100.00%> (ø)
strawberryfields/utils/states.py 100.00% <100.00%> (ø)

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 0765e2c...4e26abb. Read the comment docs.