You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document focuses on getting any potential contributor familiarized
6
-
with the development processes, but [other kinds of contributions](https://opensource.guide/how-to-contribute) are also
7
-
appreciated.
5
+
This document focuses on getting any potential contributor familiarized with the development processes,
6
+
but [other kinds of contributions](https://opensource.guide/how-to-contribute) are also appreciated.
8
7
9
-
If you are new to using git_ or have never collaborated in a project previously,
10
-
please have a look at [contribution-guide.org](https://www.contribution-guide.org/). Other resources are also
11
-
listed in the excellent [guide created by FreeCodeCamp](https://github.com/FreeCodeCamp/how-to-contribute)[#contrib1]_.
8
+
If you are new to using git or have never collaborated in a project previously, please have a look at
9
+
[contribution-guide.org](https://www.contribution-guide.org/). Other resources are also listed in the
10
+
excellent [guide created by FreeCodeCamp](https://github.com/FreeCodeCamp/how-to-contribute).
12
11
13
-
Please notice, all users and contributors are expected to be **open,
14
-
considerate, reasonable, and respectful**. When in doubt, [Python Software
15
-
Foundation's Code of Conduct](https://www.python.org/psf/conduct/) is a good reference in terms of behavior
16
-
guidelines.
12
+
Please notice, all users and contributors are expected to be **open, considerate, reasonable, and
13
+
respectful**. When in doubt, [Python Software Foundation's Code of Conduct](https://www.python.org/psf/conduct/)
14
+
is a good reference in terms of behavior guidelines.
17
15
18
16
## Issue Reports
19
17
20
-
If you experience bugs or general issues with ``grelu``, please have a look
21
-
on the [issue tracker](https://github.com/Genentech/gReLU/issues). If you don't see anything useful there, please feel
22
-
free to fire an issue report.
18
+
If you experience bugs or general issues with ``gReLU``, please have a look at the
19
+
[issue tracker](https://github.com/Genentech/gReLU/issues). If you don't see anything useful there, please
20
+
file a new issue report.
23
21
24
-
**Tip:** Please don't forget to include the closed issues in your search.
25
-
Sometimes a solution was already reported, and the problem is considered
26
-
**solved**.
22
+
(Don't forget to include the closed issues in your search. Sometimes a solution was already reported, and
23
+
the problem is considered solved.)
27
24
28
-
New issue reports should include information about your programming environment
29
-
(e.g., operating system, Python version) and steps to reproduce the problem.
30
-
Please try also to simplify the reproduction steps to a very minimal example
31
-
that still illustrates the problem you are facing. By removing other factors,
32
-
you help us to identify the root cause of the issue.
25
+
You can file a new issue by clicking the "New issue" button at the top right of the issue tracker.
26
+

33
27
34
-
## Documentation Improvements
28
+
Your new issue report should include the following information:
35
29
36
-
You can help improve ``grelu`` docs by making them more readable and coherent, or
37
-
by adding missing information and correcting mistakes.
30
+
1. Information about your programming environment (e.g., operating system, Python version)
31
+
2. Steps to reproduce the problem. Please try to simplify the reproduction steps to a very minimal example
32
+
that still illustrates the problem you are facing. By removing other factors, you help us to identify the
33
+
root cause of the issue.
34
+
4. The full error message that you encountered, if any.
35
+
5. Any steps that you took to diagnose or fix the issue, and their outcomes.
36
+
6. Any suggestions for resolving the issue.
38
37
39
-
``grelu`` documentation uses [Sphinx](https://www.sphinx-doc.org/en/master/) as its main documentation compiler.
40
-
This means that the docs are kept in the same repository as the project code, and
41
-
that any documentation update is done in the same way was a code contribution.
42
38
43
-
**TODO:** Don't forget to mention which markup language you are using.
39
+
## Making code contributions
44
40
45
-
e.g., reStructuredText_ or CommonMark_ with MyST_ extensions.
41
+
### Coding resources
46
42
47
-
**TODO:** If your project is hosted on GitHub, you can also mention the following tip:
43
+
``gReLU`` uses pytorch and pytorch-lightning. The below tutorials are good starting points to become familiar
44
+
with these frameworks:
48
45
49
-
**Tip:** Please notice that the [GitHub web interface](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files) provides a quick way of
50
-
propose changes in ``grelu``'s files. While this mechanism can
51
-
be tricky for normal code contributions, it works perfectly fine for
If you are interested in trying this method out, please navigate to
55
-
the ``docs`` folder in the source repository_, find which file you
56
-
would like to propose changes and click in the little pencil icon at the
57
-
top, to open [GitHub's code editor](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files). Once you finish editing the file,
58
-
please write a message in the form at the bottom of the page describing
59
-
which changes have you made and what are the motivations behind them and
| Functions to read / write genomic data |[`grelu.io`](https://genentech.github.io/gReLU/autoapi/grelu/io/index.html)|
68
+
| Functions to preprocess genomic data after it is loaded |[`grelu.data.preprocess`](https://genentech.github.io/gReLU/autoapi/grelu/data/preprocess/index.html)|
69
+
| New augmentation functions for training models |[`grelu.data.augment`](https://genentech.github.io/gReLU/autoapi/grelu/data/augment/index.html)|
70
+
| Functions to introduce various types of in silico mutations into DNA sequences |[`grelu.sequence.mutate`](https://genentech.github.io/gReLU/autoapi/grelu/sequence/mutate/index.html)|
71
+
| Other functions to manipulate DNA sequences |[`grelu.sequence.utils`](https://genentech.github.io/gReLU/autoapi/grelu/sequence/utils/index.html)|
72
+
| Functions to score DNA sequences based on their content |[`grelu.transforms.seq_transforms`](https://genentech.github.io/gReLU/autoapi/grelu/transforms/seq_transforms/index.html)|
73
+
| Functions to transform model predictions |[`grelu.transforms.prediction_transforms`](https://genentech.github.io/gReLU/autoapi/grelu/transforms/prediction_transforms/index.html)|
74
+
| New types of model layers |[`grelu.model.layers`](https://genentech.github.io/gReLU/autoapi/grelu/model/layers/index.html)|
75
+
| New model architectures |[`grelu.model.models`](https://genentech.github.io/gReLU/autoapi/grelu/model/models/index.html)|
76
+
| New loss functions |[`grelu.lightning.losses`](https://genentech.github.io/gReLU/autoapi/grelu/lightning/losses/index.html)|
77
+
| New metrics to calculate model performance |[`grelu.lightning.metrics`](https://genentech.github.io/gReLU/autoapi/grelu/lightning/metrics/index.html)|
78
+
| New plots and visualizations |[`grelu.visualize`](https://genentech.github.io/gReLU/autoapi/grelu/visualize/index.html)|
71
79
72
-
## Code Contributions
80
+
For complex changes that may not fit clearly within the established package structure, it is important to first
81
+
raise an issue (see instructions below).
73
82
74
-
**TODO:** Please include a reference or explanation about the internals of the project.
75
83
76
-
An architecture description, design principles or at least a summary of the
77
-
main concepts will make it easy for potential contributors to get started
78
-
quickly.
84
+
## Step-by-step instructions to contribute new code
79
85
80
-
Submit an issue
81
-
---------------
86
+
### Submit an issue
82
87
83
-
Before you work on any non-trivial code contribution it's best to first create
84
-
a report in the [issue tracker](https://github.com/Genentech/gReLU/issues) to start a discussion on the subject.
88
+
Before you work on any non-trivial code contribution it's best to first create an issue in the
89
+
[issue tracker](https://github.com/Genentech/gReLU/issues) to start a discussion on the subject.
85
90
This often provides additional considerations and avoids unnecessary work.
86
91
87
-
Create an environment
88
-
---------------------
92
+
### Create an environment
89
93
90
94
Before you start coding, we recommend creating an isolated [virtual
91
-
environment](https://realpython.com/python-virtual-environments-a-primer/) to avoid any problems with your installed Python packages.
92
-
This can easily be done via either [virtualenv](https://virtualenv.pypa.io/en/stable/)::
93
-
95
+
environment](https://realpython.com/python-virtual-environments-a-primer/) to avoid any problems with your
96
+
installed Python packages. This can easily be done via either [virtualenv](https://virtualenv.pypa.io/en/stable/):
97
+
```
94
98
virtualenv <PATH TO VENV>
95
99
source <PATH TO VENV>/bin/activate
96
-
97
-
or [Miniconda](https://docs.conda.io/en/latest/miniconda.html)::
98
-
100
+
```
101
+
or [Miniconda](https://docs.conda.io/en/latest/miniconda.html):
102
+
```
99
103
conda create -n grelu python=3 six virtualenv pytest pytest-cov
100
104
conda activate grelu
105
+
```
106
+
### Clone the repository
101
107
102
-
Clone the repository
103
-
--------------------
108
+
1. Create an user account on [GitHub](https://github.com), if you do not already have one.
109
+
2. Fork the [project repository](https://github.com/Genentech/gReLU/): click on the *Fork* button near the top of
110
+
the page. This creates a copy of the code under your account on [GitHub](https://github.com/).
104
111
105
-
1. Create an user account on [the repository service](https://github.com). if you do not already have one.
106
-
2. Fork the project repository_: click on the *Clone* button near the top of the
107
-
page. This creates a copy of the code under your account on [the repository service](https://github.com/).
Please make sure to see the validation messages from [pre-commit](https://pre-commit.com/) and fix any issues.
158
+
This should automatically use [flake8](https://flake8.pycqa.org/en/stable/)/[black](https://pypi.org/project/black/)
159
+
to check/fix the code style in a way that is compatible with the project.
166
160
167
-
5. Please check that your changes don't break any unit tests with::
161
+
### Test your changes
168
162
163
+
Please check that your changes don't break any unit tests with::
164
+
```
169
165
tox
170
-
166
+
```
171
167
(after having installed [tox](https://tox.wiki/en/stable/) with ``pip install tox`` or ``pipx``).
172
-
173
168
You can also use [tox](https://tox.wiki/en/stable/) to run several other pre-configured tasks in the
174
169
repository. Try ``tox -av`` to see a list of the available checks.
175
170
176
-
Submit your contribution
177
-
------------------------
178
-
179
-
1. If everything works fine, push your local branch to [the repository service](https://github.com/) with::
171
+
### Submit your contribution
180
172
173
+
1. If everything works fine, push your local branch to [GitHub](https://github.com/) with:
174
+
```
181
175
git push -u origin my-feature
182
-
176
+
```
183
177
2. Go to the web page of your fork and click "Create pull request"
184
178
to send your changes for review.
185
179
186
-
**TODO:** if you are using GitHub, you can uncomment the following paragraph
187
-
188
-
Find more detailed information in [creating a PR](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). You might also want to open
189
-
the PR as a draft first and mark it as ready for review after the feedbacks
190
-
from the continuous integration (CI) system or any required fixes.
180
+
Find more detailed information in [creating a PR](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). You might also want to open the PR as a draft first and mark it as ready for review
181
+
after the feedback from the continuous integration (CI) system or any required fixes.
191
182
192
183
## Troubleshooting
193
184
@@ -206,13 +197,13 @@ package:
206
197
``setup.cfg`` and ``docs/requirements.txt``. If you find any problems with
207
198
missing dependencies when running a command with [tox](https://tox.wiki/en/stable/), try to recreate the
208
199
``tox`` environment using the ``-r`` flag. For example, instead of::
209
-
200
+
```shell
210
201
tox -e docs
211
-
202
+
```
212
203
Try running::
213
-
204
+
```shell
214
205
tox -r -e docs
215
-
206
+
```
216
207
3. Make sure to have a reliable [tox](https://tox.wiki/en/stable/) installation that uses the correct
217
208
Python version (e.g., 3.7+). When in doubt you can run::
218
209
@@ -223,31 +214,25 @@ package:
223
214
```
224
215
225
216
If you have trouble and are seeing weird errors upon running [tox](https://tox.wiki/en/stable/), you can
226
-
also try to create a dedicated [virtual environment](https://realpython.com/python-virtual-environments-a-primer/) with a [tox](https://tox.wiki/en/stable/) binary
227
-
freshly installed. For example::
217
+
also try to create a dedicated [virtual environment](https://realpython.com/python-virtual-environments-a-primer/)
218
+
with a [tox](https://tox.wiki/en/stable/) binary freshly installed. For example::
228
219
229
220
virtualenv .venv
230
221
source .venv/bin/activate
231
222
.venv/bin/pip install tox
232
223
.venv/bin/tox -e all
233
224
234
-
4.[Pytest can drop you](https://docs.pytest.org/en/stable/how-to/failures.html#using-python-library-pdb-with-pytest) in an interactive session in the case an error occurs.
235
-
In order to do that you need to pass a ``--pdb`` option (for example by
225
+
4.[Pytest can drop you](https://docs.pytest.org/en/stable/how-to/failures.html#using-python-library-pdb-with-pytest) in an
226
+
interactive session in the case an error occurs. In order to do that you need to pass a ``--pdb`` option (for example by
236
227
running ``tox -- -k <NAME OF THE FALLING TEST> --pdb``).
237
228
You can also setup breakpoints manually instead of using the ``--pdb`` option.
238
229
239
230
## Maintainer tasks
240
231
241
232
### Releases
242
233
243
-
**TODO:** This section assumes you are using PyPI to publicly release your package.
244
-
245
-
If instead you are using a different/private package index, please update
246
-
the instructions accordingly.
247
-
248
-
If you are part of the group of maintainers and have correct user permissions
249
-
on [PyPI](https://pypi.org/), the following steps can be used to release a new version for
250
-
``grelu``:
234
+
If you are part of the group of maintainers and have correct user permissions on [PyPI](https://pypi.org/),
235
+
the following steps can be used to release a new version for ``grelu``:
251
236
252
237
1. Make sure all unit tests are successful.
253
238
2. Tag the current commit on the main branch with a release tag, e.g., ``v1.2.3``.
@@ -256,23 +241,8 @@ on [PyPI](https://pypi.org/), the following steps can be used to release a new v
256
241
(or ``rm -rf dist build``)
257
242
to avoid confusion with old builds and Sphinx docs.
258
243
5. Run ``tox -e build`` and check that the files in ``dist`` have
259
-
the correct version (no ``.dirty`` or git_ hash) according to the git_ tag.
244
+
the correct version (no ``.dirty`` or git hash) according to the git tag.
260
245
Also check the sizes of the distributions, if they are too big (e.g., >
261
246
500KB), unwanted clutter may have been accidentally included.
262
247
6. Run ``tox -e publish -- --repository pypi`` and check that everything was
263
248
uploaded to PyPI_ correctly.
264
-
265
-
.. [#contrib1] Even though, these resources focus on open source projects and
266
-
communities, the general ideas behind collaborating with other developers
267
-
to collectively create software are general and can be applied to all sorts
268
-
of environments, including private companies and proprietary code bases.
269
-
270
-
.. <-- start -->
271
-
**TODO:** Please review and change the following definitions:
0 commit comments