|
1 | 1 | Contributing |
2 | 2 | ============ |
3 | 3 |
|
4 | | -Bug reports, feature suggestions and other contributions are greatly |
5 | | -appreciated! Pysat is a community-driven project and welcomes both feedback and |
6 | | -contributions. |
| 4 | +Bug reports, feature suggestions, and other contributions are greatly |
| 5 | +appreciated! |
7 | 6 |
|
8 | 7 | Short version |
9 | | -============= |
| 8 | +------------- |
| 9 | + |
| 10 | +* Submit bug reports, feature requests, and questions at |
| 11 | + [GitHub](https://github.com/CosmicStudioSoftware/OMMBV/issues) |
10 | 12 |
|
11 | | -* Submit bug reports and feature requests at `GitHub <https://github.com/rstoneback/OMMBV/issues>`_ |
12 | 13 | * Make pull requests to the ``develop`` branch |
13 | 14 |
|
| 15 | +Issues |
| 16 | +------ |
| 17 | + |
| 18 | +Bug reports, questions, and feature requests should all be made as GitHub |
| 19 | +Issues. Templates are provided for each type of issue, to help you include |
| 20 | +all the necessary information. |
| 21 | + |
| 22 | +Questions |
| 23 | +^^^^^^^^^ |
| 24 | + |
| 25 | +Not sure how something works? Ask away! The more information you provide, the |
| 26 | +easier the question will be to answer. |
| 27 | + |
14 | 28 | Bug reports |
15 | | -=========== |
| 29 | +^^^^^^^^^^^ |
16 | 30 |
|
17 | | -When `reporting a bug <https://github.com/rstoneback/OMMBV/issues>`_ please |
| 31 | +When [reporting a bug](https://github.com/CosmicStudioSoftware/OMMBV/issues) please |
18 | 32 | include: |
19 | 33 |
|
20 | 34 | * Your operating system name and version |
| 35 | + |
21 | 36 | * Any details about your local setup that might be helpful in troubleshooting |
| 37 | + |
22 | 38 | * Detailed steps to reproduce the bug |
23 | 39 |
|
24 | 40 | Feature requests and feedback |
25 | | -============================= |
| 41 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
26 | 42 |
|
27 | | -The best way to send feedback is to file an issue at |
28 | | -`GitHub <https://github.com/rstoneback/OMMBV/issues>`_. |
| 43 | +The best way to send feedback is to file an |
| 44 | +[issue](https://github.com/CosmicStudioSoftware/OMMBV/issues). |
29 | 45 |
|
30 | | -If you are proposing a feature: |
| 46 | +If you are proposing a new feature or a change in something that already exists: |
31 | 47 |
|
32 | 48 | * Explain in detail how it would work. |
| 49 | + |
33 | 50 | * Keep the scope as narrow as possible, to make it easier to implement. |
| 51 | + |
34 | 52 | * Remember that this is a volunteer-driven project, and that code contributions |
35 | 53 | are welcome :) |
36 | 54 |
|
37 | 55 | Development |
38 | | -=========== |
| 56 | +----------- |
| 57 | + |
| 58 | +To set up `OMMBV` for local development: |
39 | 59 |
|
40 | | -To set up `pysat` for local development: |
| 60 | +1. [Fork OMMBV on GitHub](https://github.com/CosmicStudioSoftware/OMMBV/fork). |
41 | 61 |
|
42 | | -1. `Fork pysat on GitHub <https://github.com/rstoneback/OMMBV/fork>`_. |
43 | | -2. Clone your fork locally:: |
| 62 | +2. Clone your fork locally: |
44 | 63 |
|
45 | | - git clone [email protected]:your_name_here/pysatMagVect.git |
| 64 | + ``` |
| 65 | + git clone [email protected]:your_name_here/OMMBV.git |
| 66 | + ``` |
46 | 67 |
|
47 | | -3. Create a branch for local development:: |
| 68 | +3. Create a branch for local development: |
48 | 69 |
|
| 70 | + ``` |
49 | 71 | git checkout -b name-of-your-bugfix-or-feature |
| 72 | + ``` |
| 73 | + |
| 74 | + Now you can make your changes locally. |
| 75 | + |
50 | 76 |
|
51 | | - Now you can make your changes locally. Tests should be added to the |
52 | | - appropriately named file in ``OMMBV/tests``. |
53 | | - |
54 | 77 | 4. When you're done making changes, run all the checks to ensure that nothing |
55 | | - is broken on your local system:: |
56 | | - |
57 | | - nosetests -vs pysatMagVect |
| 78 | + is broken on your local system, as well as check for flake8 compliance: |
| 79 | + |
| 80 | + ``` |
| 81 | + pytest |
| 82 | + ``` |
| 83 | + |
| 84 | +5. You should also check for flake8 style compliance: |
| 85 | + |
| 86 | + ``` |
| 87 | + flake8 . --count --select=D,E,F,H,W --show-source --statistics |
| 88 | + ``` |
58 | 89 |
|
59 | | -5. Update/add documentation (in ``docs``), if relevant |
| 90 | + Note that pysat uses the `flake-docstrings` and `hacking` packages to ensure |
| 91 | + standards in docstring formatting. |
60 | 92 |
|
61 | | -5. Commit your changes and push your branch to GitHub:: |
| 93 | +6. Update/add documentation (in ``docs``). Even if you don't think it's |
| 94 | + relevant, check to see if any existing examples have changed. |
62 | 95 |
|
63 | | - git add . |
64 | | - git commit -m "Brief description of your changes" |
65 | | - git push origin name-of-your-bugfix-or-feature |
| 96 | +7. Add your name to the .zenodo.json file as an author |
| 97 | + |
| 98 | +8. Commit your changes: |
| 99 | + ``` |
| 100 | + git add . |
| 101 | + git commit -m "AAA: Brief description of your changes" |
| 102 | + ``` |
| 103 | + Where AAA is a standard shorthand for the type of change (e.g., BUG or DOC). |
| 104 | + `pysat` follows the [numpy development workflow](https://numpy.org/doc/stable/dev/development_workflow.html), |
| 105 | + see the discussion there for a full list of this shorthand notation. |
| 106 | + |
| 107 | +9. Once you are happy with the local changes, push to GitHub: |
| 108 | + ``` |
| 109 | + git push origin name-of-your-bugfix-or-feature |
| 110 | + ``` |
| 111 | + Note that each push will trigger the Continuous Integration workflow. |
| 112 | + |
| 113 | +10. Submit a pull request through the GitHub website. Pull requests should be |
| 114 | + made to the ``develop`` branch. Note that automated tests will be run on |
| 115 | + GitHub Actions, but these must be initialized by a member of the pysat team |
| 116 | + for first time contributors. |
66 | 117 |
|
67 | | -6. Submit a pull request through the GitHub website. Pull requests should be |
68 | | - made to the ``develop`` branch. |
69 | 118 |
|
70 | 119 | Pull Request Guidelines |
71 | 120 | ----------------------- |
72 | 121 |
|
73 | 122 | If you need some code review or feedback while you're developing the code, just |
74 | | -make a pull request. |
| 123 | +make a pull request. Pull requests should be made to the ``develop`` branch. |
75 | 124 |
|
76 | 125 | For merging, you should: |
77 | 126 |
|
78 | 127 | 1. Include an example for use |
79 | 128 | 2. Add a note to ``CHANGELOG.md`` about the changes |
80 | | -3. Ensure that all checks passed (current checks include Scrutinizer, Travis-CI, |
81 | | - and Coveralls) [1]_ |
82 | | - |
83 | | -.. [1] If you don't have all the necessary Python versions available locally or |
84 | | - have trouble building all the testing environments, you can rely on |
85 | | - Travis to run the tests for each change you add in the pull request. |
86 | | - Because testing here will delay tests by other developers, please ensure |
87 | | - that the code passes all tests on your local system first. |
| 129 | +3. Update the author list in ``zenodo.json``, if applicable |
| 130 | +4. Ensure that all checks passed (current checks include GitHub Actions, |
| 131 | + Coveralls and ReadTheDocs) |
| 132 | + |
| 133 | +If you don't have all the necessary Python versions available locally or have |
| 134 | +trouble building all the testing environments, you can rely on GitHub Actions to |
| 135 | +run the tests for each change you add in the pull request. Because testing here |
| 136 | +will delay tests by other developers, please ensure that the code passes all |
| 137 | +tests on your local system first. |
| 138 | + |
| 139 | + |
| 140 | +Project Style Guidelines |
| 141 | +------------------------ |
| 142 | + |
| 143 | +In general, OMMBV follows PEP8 and numpydoc guidelines. Pytest runs the unit |
| 144 | +and integration tests, flake8 checks for style, and sphinx-build performs |
| 145 | +documentation tests. However, there are certain additional style elements that |
| 146 | +have been adopted to ensure the project maintains a consistent coding style. |
| 147 | +These include: |
| 148 | + |
| 149 | +* Line breaks should occur before a binary operator (ignoring flake8 W503) |
| 150 | +* Combine long strings using `join` |
| 151 | +* Preferably break long lines on open parentheses rather than using `\` |
| 152 | +* Use no more than 80 characters per line |
| 153 | +* Several dependent packages have common nicknames, including: |
| 154 | + * `import datetime as dt` |
| 155 | + * `import numpy as np` |
| 156 | + * `import pandas as pds` |
| 157 | + * `import xarray as xr` |
| 158 | +* When incrementing a timestamp, use `dt.timedelta` instead of `pds.DateOffset` |
| 159 | + when possible to reduce program runtime |
| 160 | +* All classes should have `__repr__` and `__str__` functions |
| 161 | +* Docstrings use `Note` instead of `Notes` |
| 162 | +* Try to avoid creating a try/except statement where except passes |
| 163 | +* Use setup_method (or setup_class) and teardown_method (or teardown_class) in |
| 164 | + test classes |
| 165 | +* Use pytest parametrize in test classes when appropriate |
| 166 | +* Provide testing class methods with informative failure statements and |
| 167 | + descriptive, one-line docstrings |
| 168 | +* Block and inline comments should use proper English grammar and punctuation |
| 169 | + with the exception of single sentences in a block, which may then omit the |
| 170 | + final period |
| 171 | +* When casting is necessary, use `np.int64` and `np.float64` to ensure operating |
| 172 | + system agnosticism |
| 173 | + |
0 commit comments