|
| 1 | + |
| 2 | +.. _devindex: |
| 3 | + |
| 4 | +Contributing to sisl |
| 5 | +==================== |
| 6 | + |
| 7 | +The sisl code is open-source, and thus we encourage external users to contribute |
| 8 | +back to the code base. |
| 9 | + |
| 10 | +Even if you are a non-coder, your contributions are valuable to the community! |
| 11 | +Please do remember that open-source projects benefits from interaction! |
| 12 | + |
| 13 | +There are many aspects of useful contributions: |
| 14 | + |
| 15 | +- Code maintenance and development |
| 16 | +- Creating tutorials and extending documentation |
| 17 | +- Finding bugs or typos |
| 18 | +- Development of the website |
| 19 | +- Missing a useful feature |
| 20 | + |
| 21 | +We understand that people have different backgrounds, and thus different |
| 22 | +experience in coding. We try to engage as much as possible with ticket creators. |
| 23 | + |
| 24 | +In the following of this document you will find information related to the specifics |
| 25 | +of making a development workflow for `sisl`. |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +Summary of development process |
| 30 | +------------------------------ |
| 31 | + |
| 32 | + |
| 33 | +Here is a short summary of how to do developments with `sisl`. |
| 34 | + |
| 35 | + |
| 36 | +1. If you are a first time contributor, you need to clone your repository |
| 37 | + and setup a few things. |
| 38 | + |
| 39 | + The procedure enables one to follow the upstream changes, while simultaneously |
| 40 | + have a fork where one has write access. |
| 41 | + |
| 42 | + * Go to `github.com/zerothi/sisl <sisl-git_>`_ and click the "fork" button to |
| 43 | + create your own copy of the code base. |
| 44 | + |
| 45 | + * Clone the fork to your local machine: |
| 46 | + |
| 47 | + .. code:: bash |
| 48 | +
|
| 49 | + git clone https://github.com/<your-username>/sisl.git |
| 50 | +
|
| 51 | + * Add the upstream repository: |
| 52 | + |
| 53 | + .. code:: bash |
| 54 | +
|
| 55 | + git remote add upstream https://github.com/zerothi/sisl.git |
| 56 | +
|
| 57 | + * Enable the `pre-commit <https://pre-commit.com>`_ hooks |
| 58 | + |
| 59 | + .. code:: bash |
| 60 | +
|
| 61 | + python -m pip install pre-commit |
| 62 | + pre-commit install |
| 63 | +
|
| 64 | + This will run specific checks before you commit things to the repo. |
| 65 | + It ensures a consistency in the project. |
| 66 | + |
| 67 | +2. Installing the project in development mode. |
| 68 | + |
| 69 | + It is adviced to instal the project in *editable* mode for faster |
| 70 | + turn-around times. |
| 71 | + Please follow :ref:`these instructions <installation-testing>`. |
| 72 | + |
| 73 | +3. Developing your contribution. |
| 74 | + |
| 75 | + First start by ensuring you have the latest changes on the ``main`` |
| 76 | + branch. |
| 77 | + |
| 78 | + .. code:: bash |
| 79 | +
|
| 80 | + git checkout main |
| 81 | + git pull upstream main |
| 82 | +
|
| 83 | + If you are fixing an already opened issue (say :issue:`42`) it is adviced |
| 84 | + to name your branch according to the issue number following a sensible name: |
| 85 | + |
| 86 | + .. code:: bash |
| 87 | +
|
| 88 | + git checkout -b 42-enhancing-doc |
| 89 | +
|
| 90 | + If no issue has been created, then just name it sensibly. |
| 91 | + |
| 92 | + Do all your commits locally as you progress. |
| 93 | + |
| 94 | + Be sure to document your changes, and write sensible documentation |
| 95 | + for the API. |
| 96 | + |
| 97 | +4. To submit your contribution: |
| 98 | + |
| 99 | + * Push your changes back to your fork on GitHub: |
| 100 | + |
| 101 | + .. code:: bash |
| 102 | +
|
| 103 | + git push origin 42-enhancing-doc |
| 104 | +
|
| 105 | + * Go to `sisl's pull request site <pr_>`_. |
| 106 | + The new branch will show up with a green Pull Request |
| 107 | + button. Make sure the title and message are clear, concise, and self- |
| 108 | + explanatory. Then click the button to submit it. |
| 109 | + |
| 110 | +5. Review process. |
| 111 | + |
| 112 | + The maintainers of `sisl` will do their best to respond as fast as possible. |
| 113 | + But first ensure that the CI runs successfully, if not, maintainers will likely |
| 114 | + wait untill it succeeds before taking any action. |
| 115 | + |
| 116 | + |
| 117 | +Contribute external code |
| 118 | +------------------------ |
| 119 | + |
| 120 | +External toolbox codes may be contributed `here <issue_>`_, then press |
| 121 | +"Issue" and select *Contribute toolbox*. |
| 122 | + |
| 123 | +There are two cases of external contributions: |
| 124 | + |
| 125 | +1. If the code is directly integratable into sisl it will be merged into the sisl source. |
| 126 | + |
| 127 | +2. If the code is showing how to use sisl to calculate some physical quantity but is not a general |
| 128 | + implementation, it will be placed in toolbox directory. |
| 129 | + |
| 130 | +Either way, any contribution is very welcome. |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | +Contribute additional tests |
| 135 | +--------------------------- |
| 136 | + |
| 137 | +Additional test files should be added to `this repository <sisl-files_>`_. |
| 138 | +Please follow the guidelines there, or open up an issue at that repository |
| 139 | +for specific details. |
0 commit comments