Snowflurry Logo

Contributing

How to Contribute

Snowflurry is a community driven project and we'd love to accept your patches and contributions to this project.

To streamline the process, we have some guidelines to follow. Please also note that we have a code of conduct to make Snowflurry an open and welcoming environment.

Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project.

Pull Request Process and Code Review

All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. GitHub Help has information on using pull requests.

The preferred manner for submitting pull requests is for users to fork the Snowflurry repository and then use a branch from this fork to create a pull request to the main Snowflurry repository.

The basic process for setting up a fork is

  1. Fork the Snowflurry repository (Fork button in upper right corner of repository page). Forking creates a new Github repository at the location https://github.com/USERNAME/Snowflurry.jl where USERNAME is your Github id. Use the directions on the development page to download a copy to your local machine. You need only do this once.

  2. Checkout master and create a new branch from this master

    git checkout master -b new_branch_name
    

    where new_branch_name is the name of your new branch.

  3. Do your work and commit your changes to this branch.

  4. If you have drifted out of sync with the master from the main Snowflurry repository you may need to merge in changes. To do this, first update your local master and then merge the local master into your branch:

    # Track the upstream repository (if your local repository hasn't):
    git remote add upstream https://github.com/SnowflurrySDK/Snowflurry.jl.git
    
    # Update your local master.
    git fetch upstream
    git checkout master
    git merge upstream/master
    # Merge local master into your branch.
    git checkout new_branch_name
    git merge master
    
    #You may need to fix merge conflicts for both of these merge commands.
    
  5. Finally, push your change to your clone

    git push origin new_branch_name
    
  6. Now when you navigate to the Snowflurry page on github, https://github.com/SnowflurrySDK/Snowflurry.jl you should see the option to create a new pull request from your clone repository. Alternatively you can create the pull request by navigating to the "Pull requests" tab in the page, and selecting the appropriate branches.

  7. The reviewer will comment on your code and may ask for changes, you can perform these locally, and then push the new commit following the same process as above.

Julia Coding Style Guide

We adhere to Julia recommended Style Guide. Please consult this document before getting started!

Code Testing Standards

When a pull request is created or updated, various automatic checks will run to ensure that the change won't break Snowflurry and meets our coding standards.

Snowflurry contains a continuous integration tool to verify testing. See our development page on how to run the continuous integration checks locally.

Please be aware of the following code standards that will be applied to any new changes.

  • Tests. Existing tests must continue to pass (or be updated) when new changes are introduced. You have two ways to run the unittests:
  1. Use Pkg.test: Type the following in the REPL:
julia>using Pkg; Pkg.test("Snowflurry"; coverage=true)
  1. Run test/runtests.jl: Include the test/runtests.jl script in the REPL:
julia> include("test/runtests.jl")
Test Summary: | Pass  Total
ket           |    7      7
Test Summary: | Pass  Total
multi_body    |    1      1
Test Summary: | Pass  Total
cnot          |    1      1
Test Summary:  | Pass  Total
phase_kickback |    1      1
  • Coverage. Code should be covered by tests. We use Coverage.jl to compute coverage. We don't require 100% coverage, but expect better than 80% code coverage.
  • VS Code Coding Style. We highly recommend developing the code in VS Code and using its Julia Formatter Extention.
Previous
Visualization