We appreciate all kinds of help, so thank you!
This guide is for those who want to extend the module or documentation. If you just want to use the package, take a look at the demo instead.
Code in this repository should conform to PEP8 standards. Style/lint checks are run to validate this. Line length must be limited to no more than 100 characters.
In order to contribute, you will need to install the module from source. If you do not have write permissions to the original DSM Swap repo, you will need to fork it to your personal account first, and submit all Pull Requests (PR) from there. Even if you have write permissions, forking the repo should always work, so this is the recommended approach.
-
Make sure you have git and pip (and optionally Miniconda) installed.
-
From the terminal, clone repository:
git clone https://github.com/qiskit-community/dsm-swap.git
Alternatively, instead of cloning the original repository, you may choose to clone your personal fork. You can do so by using the appropriate URL and adding the original repo to the list of remotes (here under the name
upstream
). This will be required for contribution unless you are granted write permissions for the original repository.git clone <YOUR-FORK-URL> git remote add upstream https://github.com/qiskit-community/dsm-swap.git
-
Change directory to the freshly cloned DSM Swap module:
cd dsm-swap
-
Install the dependencies needed:
pip install .
-
(Optional) Install the repo in editable mode and with developer dependencies for contributing:
pip install -e .[dev]
-
To make a contribution, first set up a remote branch (here called
my-contribution
) either in your fork (i.e.origin
) or the original repo (i.e.upstream
). In the absence of a fork, the (only) remote will simply be referred to all the time by the nameorigin
(i.e. replaceupstream
in all commands):git checkout main git pull origin git checkout -b my-contribution
... make your contribution now (edit some code, add some files) ...
git add . git commit -m 'initial working version of my contribution' git push -u origin my-contribution
-
Before making a Pull Request always get the latest changes from
main
(upstream
if there is a fork,origin
otherwise):git checkout main git pull upstream git checkout my-contribution git merge main
... fix any merge conflicts here ...
git add . git commit -m 'merged updates from main' git push
-
Go back to the appropriate DSM Swap repo on GitHub (i.e. fork or original), switch to your contribution branch (same name:
my-contribution
), and click "Pull Request". Write a clear explanation of the feature. -
Under Reviewer, select Nicola Mariella and Anton Dekusar.
-
Click "Create Pull Request".
-
Your Pull Request will be reviewed and, if everything is ok, it will be merged.
When submitting a pull request and you feel it is ready for review, please ensure that the code follows the code style of this project.
DSM Swap uses Pylint, Black and PEP8 style guidelines. For this you can run:
black dsm_swap
and
pylint -rn dsm_swap
Other than submitting new source code, users can contribute in the following meaningful ways:
- Reporting Bugs and Requesting Features: Users are encouraged to use Github Issues for reporting issues are requesting features.
- Ask/Answer Questions and Discuss DSM Swap: Users are encouraged to use Github Discussions for engaging with researchers, developers, and other users regarding this project.