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

Updating the io.load function docstring. #314

Merged
merged 2 commits into from
Mar 11, 2020
Merged

Conversation

antalszava
Copy link
Contributor

Updating the io.load function docstring.

@codecov
Copy link

codecov bot commented Mar 11, 2020

Codecov Report

❗ No coverage uploaded for pull request base (demo@a166e51). Click here to learn what that means.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             demo     #314   +/-   ##
=======================================
  Coverage        ?   97.74%           
=======================================
  Files           ?       49           
  Lines           ?     6172           
  Branches        ?        0           
=======================================
  Hits            ?     6033           
  Misses          ?      139           
  Partials        ?        0
Impacted Files Coverage Δ
strawberryfields/io.py 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 a166e51...471b71a. Read the comment docs.

@antalszava antalszava merged commit 728cb8b into demo Mar 11, 2020
@antalszava antalszava deleted the io_load_docstring branch March 11, 2020 15:58
josh146 added a commit that referenced this pull request Mar 19, 2020
* First draft

* Add test for async job

* Simplify starship CLI

* Fix bug with output logic

* Logic of load_config before testing

* Linting and cleanup

* Linting, docs, cleanup

* Linting, formatting

* Consolidate exceptions

* StarshipEngine.run() raises exception if remote job enters failed status

* Polish docstrings

* Add type hints

* More tests

* Cleanup

* Testing config object creation, look_for_config_file function

* Request numpy job result directly from remote

* Bugfixes

* Fix issues regarding job result dimensions

* Clean up docs

* APIClient has been absorbed into the new classes

* Tests

* Add magic methods, polish docs, cleanup

* Connection.create_job() accepts Program directly instead of serialized blackbird

* Unit tests for the parts making up load_config

* Fix Result.samples to have correct dims of (shots, modes)

* Unit test for load_config; removing MagicMock from parse_environment_variable test; adding teardown logic for env vars; correcting typo

* Marking xfail API Client tests (being refactored in another PR)

* Marking xfail API Client tests (being refactored in another PR)

* Adding xfail mark on another API Client test

* Docstrings, reorganizing parse_environment_variables function, adding DEFAULT_CONFIG as module attribute

* Add create config object test with every keyword argument

* Fix Result.samples to have correct dims of (shots, modes)

* Adding load_config tests using each units separately; change logic for kwargs update; add logic for integer parsing from env vars; add tests

* Test docstrings

* Default config refactor

* Add absolute path test

* Tests

* Tests

* Tests

* Saving path, linting, isort

* Modify dict formatting in docstring

* Dimensions

* Linting, comments, cleanup

* Update tests/frontend/test_configuration.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Modifying docstrings based on comments

* Modifying tests such that look_for_config_in_file returns a tuple;
adding user_config_dir mocking logic to test

* Update tests/frontend/test_configuration.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Updating test data

* Update tests/frontend/test_configuration.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Update strawberryfields/configuration.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Update strawberryfields/configuration.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Update strawberryfields/configuration.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Docstring and comment

* Docstrings, renaming to load_config_file_if_found, adding defaults to module level attributes

* Change function to get_config_filepath and adjust tests as well accordingly; change load_config using it

* Renaming create_config

* Modifying tests to use setenv from monkeypatching in tests

* Small change for readability

* Rename 'terminal' to 'final'

* Simplify request functions

* Rename 'complete' to 'completed' where relevant

* Use MockResponse class

* Update tests/frontend/test_engine.py

Co-Authored-By: antalszava <[email protected]>

* Adding configuration options and environment variables to module docstring, inserting refs to these in function docstrings, correcting Kwargs section naming in docstrings

* Removing redundant return None statement

* Remove update_config function, add keep_valid_options function and add tests

* Addig DEFAULT_CONFIG_SPEC

* Removed debug option for now

* Update strawberryfields/configuration.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/configuration.py

Co-Authored-By: Josh Izaac <[email protected]>

* Moving configuration details to page, updating the configuration page with kwargs, adding port to file and env vars

* Update strawberryfields/configuration.py

Co-Authored-By: Josh Izaac <[email protected]>

* Applying comments: Configuration page modification, removing redundant module attributes, reword module docstring

* CHANGELOG

* First draft of store_account

* Update strawberryfields/engine.py

Co-Authored-By: Josh Izaac <[email protected]>

* Unit tests and docstrings

* Update strawberryfields/engine.py

Co-Authored-By: Josh Izaac <[email protected]>

* Added extra unit test, modified the configuration.rst

* Modified configuration page; renamed configuration location parameter and recognized arguments

* Refactor Connection, Job, Result to modules under api namespace

* Add non-recognized option and test

* Linting

* Docstrings, adjusting webpage description

* Refactor tests into coherent modules

* Small test refactor

* Check exception messages in tests

* Don't raise error on refreshing final job

* Log warning instead of raising error if remote job fails

* Parametrize numpy dtype in job result test

* Load default args for Connection from config module

* Add verbose mode for Connection

* Use prompt syntax for docstring examples in StarshipEngine and Connection

* Update thewalrus dependency to pass CI

* Add test marker for API package

* Add/update docstrings

* Pylint, general cleanup

* Add argument check for cancel_job test

* Update tests/api/test_starship_engine.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Update tests/api/test_starship_engine.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Update tests/api/test_result.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Update tests/api/test_job.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Update the link for thewalrus in requirements.txt

Equivalent to the PR on master #307

* Update error tests for job.cancel()

* Move mock_return to conftest; pylint compliance

* Remove redundant return descriptions from property docstrings

* Update strawberryfields/engine.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Small changes to docstrings based on review

* Update strawberryfields/engine.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Clean up docstrings

* Update strawberryfields/engine.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Update starship

Co-Authored-By: Nathan Killoran <[email protected]>

* Update strawberryfields/api/result.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Update strawberryfields/api/result.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Update strawberryfields/api/result.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Update strawberryfields/api/result.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Adding the testfilename fixture

* Update doc/introduction/configuration.rst

Co-Authored-By: Nathan Killoran <[email protected]>

* Title adjustment

* Update strawberryfields/configuration.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Update strawberryfields/configuration.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Update strawberryfields/configuration.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Applying suggested changes

* Reword configuration description

* Swap the default for location to user_config

* Update doc/introduction/configuration.rst

Co-Authored-By: Josh Izaac <[email protected]>

* Use clearer 'blocking'/'non-blocking' terminology where relevant

* Remove obsolete exception

* Fix Result.samples dimensions to (shots, modes)

* Read target from program

* Update imports

* Remove samples transpose in starship CLI

* Clean up config loading logic

* Simplify JobStatus string repr

* Moving tmpdir.join calls to conftest -> changing to a function scoped fixture type (as required by tmpdir); adding integration tests to store_account; refactoring configuration test file to use test_filename and test_filepath fixtures; creating mock version of create_confing and a mock class for store_account tests

* Update configuration.rst

* Update strawberryfields/configuration.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update configuration.rst

* Update configuration.rst

* Update configuration.rst

* Update strawberryfields/configuration.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/configuration.py

Co-Authored-By: Josh Izaac <[email protected]>

* Updating __init__

* Updating docstring to use raw strings

* Change job status property to string instead of enum

* Update strawberryfields/api/result.py

Co-Authored-By: antalszava <[email protected]>

* Update strawberryfields/engine.py

Co-Authored-By: antalszava <[email protected]>

* Clean up docstrings

* update store_account logic with no directory case

* Add new api package to docs

* Fixed a couple of outdated docstring types

* Update strawberryfields/engine.py

Co-Authored-By: Nathan Killoran <[email protected]>

* Minor cleanup

* Add api package tests to makefile and travis config

* Adding nested directory creation logic; adding tests

* Reword warning message.

* Mention committing the auth token

* Reword description of local config

* Adjust ordering in toctree to be alphabetical

* Adding examples to the docstring

* Update docstring

* Reverting to having the test data in the tests instead of in fixtures

* cloud -> Cloud

* Rewording

* Revert test changes, minor modifications

* Update doc/introduction/configuration.rst

Co-Authored-By: Josh Izaac <[email protected]>

* Update doc/introduction/configuration.rst

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/configuration.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/configuration.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/configuration.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/configuration.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/configuration.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update doc/introduction/configuration.rst

Co-Authored-By: Josh Izaac <[email protected]>

* Update doc/introduction/configuration.rst

Co-Authored-By: Josh Izaac <[email protected]>

* Modifications from comments

* Fixes a bug in the MZgate convention by reversing the internal and external phase arguments. (#301)

* update MZgate

* update changelog

* Update .github/CHANGELOG.md

Co-Authored-By: Josh Izaac <[email protected]>

* added tests

* remove chip0 test

* fix failing test

* Apply suggestions from code review

* swap comment in template

* added test with non-standard angles

Co-authored-by: Nathan Killoran <[email protected]>

* Update docstring example

* Remove token from CLI args - load using normal config logic

* Re-black with line length 100

* Update changelog

* CHANGELOG

* Linting

* Blacking; isort sf/__init__.py

* Update strawberryfields/api/result.py

Co-Authored-By: Theodor <[email protected]>

* Remove unused import

* merge master into demo

* Change default hostname (#309)

* localhost -> platform.xanadu.ai

* Changing hostname occurrences to platform.strawberryfields.ai

* fix tutorial teleportation

* fix post-selection tutorial

* updated more tutorials

* updated build

* added new

* documentation fixes

* more docs fixes

* temporarily add tutorial cache

* undo cache

* docs styling

* Updating io.load docstring

* Updating the `io.load` function docstring. (#314)

* Updating io.load docstring

* Updating io.load docstring

* Refactoring the starship CLI and adding unit tests (#312)

* Creating module level connection attribute

* Reorganizing the starship CLI, adding test folder

* Refactoring code for the starship cli

* Rename CLI main function

* Initial tests

* localhost -> platform.xanadu.ai

* Changing hostname occurrences to platform.strawberryfields.ai

* CLI options

* Adding the parser options and related tests

* Parser modifications

* Adjusting CLI subparsers to have default funcs

* Help instructions

* Renaming input to run

* Adding bb script exception handling, restoring prompting mechanism, docstrings

* Update strawberryfields/cli/__init__.py

Co-Authored-By: Josh Izaac <[email protected]>

* Remove module attribute connection object and instead instantiate each time pinging is triggered; add logic to check for the success of pinging

* Modifying tests

* CreateParser tests

* CreateParser tests

* Configure unit tests

* Add configure_everything unit tests

* Output relevant exit message if auth token was not supplied, adjust test

* Docstrings, adjusting test

* Tests for run_blackbird_script and write_script_results

* Docstrings in the test file; finalizing tests

* Change to pytest.mark.fronted

* Isort

* Update strawberryfields/cli/__init__.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/cli/__init__.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/cli/__init__.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/cli/__init__.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/cli/__init__.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/cli/__init__.py

Co-Authored-By: Josh Izaac <[email protected]>

* Rewording the configuration alternatives in docstring

* Renaming to configuration_wizard; moving sys.exit out of cli.ping(); adjusting tests and creating two very simple mock Connection classes

* Adjusting tests such that the asserts are out of the with context

* Removing sys.exit for pinging

* Moving messages into the input statements for the wizard

* Removing unnecessary conftest.

* Using capsys

* Adding missing assert

* Adding configuration CLI examples

* Add malformed results message

* Simplifying mock test; result is None test now regards the sysexit

* Update strawberryfields/cli/__init__.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/cli/__init__.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/cli/__init__.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/cli/__init__.py

Co-Authored-By: Josh Izaac <[email protected]>

* Update strawberryfields/cli/__init__.py

Co-Authored-By: Josh Izaac <[email protected]>

* Pinning the ANTLR version

* Changing help message for the input command

* Moving to the usage generated by default

* CHANGELOG

* CHANGELOG

Co-authored-by: Josh Izaac <[email protected]>

* Update the usage occurrences in the docstrings, fix up missing assertions in test, remove the assertion for usage (not set anymore)

* Update tests/frontend/test_starship.py

Co-Authored-By: Josh Izaac <[email protected]>

* Updating parser description

* Rename StarshipEngine to RemoteEngine, starship CLI to sf (#316)

* Rename Starship

* fix tests

* fix comment

* Update tests/frontend/test_circuitspecs_chip2.py

* pin pytest version

* add sf_cli page

* Correct CLI docstring and test typos (#318)

* Updating io.load docstring

* Update the usage occurrences in the docstrings, fix up missing assertions in test, remove the assertion for usage (not set anymore)

* Update tests/frontend/test_starship.py

Co-Authored-By: Josh Izaac <[email protected]>

* Updating parser description

Co-authored-by: Josh Izaac <[email protected]>

* reorder index

* updated changelog

* typo

* update setup.py

* Apply suggestions from code review

Co-Authored-By: antalszava <[email protected]>

* suggested changes

* Apply suggestions from code review

Co-Authored-By: Tom Bromley <[email protected]>

* Apply suggestions from code review

Co-Authored-By: Nathan Killoran <[email protected]>
Co-Authored-By: Theodor <[email protected]>

* Add apps example (#321)

* Add apps example

* Clarify WAW encoding

* Apply suggestions from code review

Co-Authored-By: Nathan Killoran <[email protected]>
Co-Authored-By: Theodor <[email protected]>

Co-authored-by: antalszava <[email protected]>
Co-authored-by: Paul Tan <[email protected]>
Co-authored-by: Nathan Killoran <[email protected]>
Co-authored-by: Theodor <[email protected]>
Co-authored-by: Tom Bromley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant