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

Add the store account function #306

Closed antalszava closed 4 years ago

antalszava commented 4 years ago

Context: The features of the Configuration class are being replaced by functions in configuration.py. Saving a configuration to a configuration file is yet to be added.

Description of the Change: Adds the store_account user-convenience function that uses the save_config_to_file auxiliary function.

Changes the configuration.rst documentation page to mirror the changes and provide simple examples.

Benefits: Provides a simple way from with Python to configure the API related details in Strawberry Fields.

Possible Drawbacks: N/A

Related GitHub Issues: N/A

codecov[bot] commented 4 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (demo@fdfc8db). Click here to learn what that means. The diff coverage is 100%.

@@           Coverage Diff           @@
##             demo     #306   +/-   ##
=======================================
  Coverage        ?   96.86%           
=======================================
  Files           ?       47           
  Lines           ?     6219           
  Branches        ?        0           
=======================================
  Hits            ?     6024           
  Misses          ?      195           
  Partials        ?        0
Impacted Files Coverage Δ
strawberryfields/configuration.py 100% <100%> (ø)

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 fdfc8db...1d5c75e. Read the comment docs.

antalszava commented 4 years ago

@co9olguy thank you so much for your comments, I've reworded the description where necessary and applied the changes!

antalszava commented 4 years ago

Updated the texts where applicable as best as I could, reverted the test data and included examples in the docstring. Also caught a bug for the case when the directory returned by user_config_dir did not exist, added logic and tests covering this.

Let me know if you have further suggestions! :blush: