Skip to content

Commit 1b74000

Browse files
authored
feat: add contributing file (#236)
1 parent a63779e commit 1b74000

File tree

1 file changed

+43
-89
lines changed

1 file changed

+43
-89
lines changed

CONTRIBUTING.md

Lines changed: 43 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -2,133 +2,87 @@
22

33
## Did you find a bug?
44

5-
- Ensure the bug was not already reported by searching on GitHub under Issues.
6-
- If you're unable to find an open issue addressing the problem, open a new one.
7-
Be sure to include a title and clear description, as much relevant information
8-
as possible, and a code sample or an executable test case demonstrating the
9-
expected behavior that is not occurring.
10-
- Be sure to add the complete error messages.
5+
* Ensure the bug was not already reported by searching on GitHub under Issues.
6+
* If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.
7+
* Be sure to add the complete error messages.
118

129
## Do you have a feature request?
1310

14-
- Ensure that it hasn't been yet implemented in the `main` branch of the
15-
repository and that there's not an Issue requesting it yet.
16-
- Open a new issue and make sure to describe it clearly, mention how it improves
17-
the project and why its useful.
11+
* Ensure that it hasn't been yet implemented in the `main` branch of the repository and that there's not an Issue requesting it yet.
12+
* Open a new issue and make sure to describe it clearly, mention how it improves the project and why its useful.
1813

1914
## Do you want to fix a bug or implement a feature?
2015

2116
Bug fixes and features are added through pull requests (PRs).
2217

23-
## PR submission guidelines
24-
25-
- Keep each PR focused. While it's more convenient, do not combine several
26-
unrelated fixes together. Create as many branches as needing to keep each PR
27-
focused.
28-
- Ensure that your PR includes a test that fails without your patch, and passes
29-
with it.
30-
- Ensure the PR description clearly describes the problem and solution. Include
31-
the relevant issue number if applicable.
32-
- Do not mix style changes/fixes with "functional" changes. It's very difficult
33-
to review such PRs and it most likely get rejected.
34-
- Do not add/remove vertical whitespace. Preserve the original style of the file
35-
you edit as much as you can.
36-
- Do not turn an already submitted PR into your development playground. If after
37-
you submitted PR, you discovered that more work is needed - close the PR, do
38-
the required work and then submit a new PR. Otherwise each of your commits
39-
requires attention from maintainers of the project.
40-
- If, however, you submitted a PR and received a request for changes, you should
41-
proceed with commits inside that PR, so that the maintainer can see the
42-
incremental fixes and won't need to review the whole PR again. In the
43-
exception case where you realize it'll take many many commits to complete the
44-
requests, then it's probably best to close the PR, do the work and then submit
45-
it again. Use common sense where you'd choose one way over another.
18+
## PR submission guidelines
19+
20+
* Keep each PR focused. While it's more convenient, do not combine several unrelated fixes together. Create as many branches as needing to keep each PR focused.
21+
* Ensure that your PR includes a test that fails without your patch, and passes with it.
22+
* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
23+
* Do not mix style changes/fixes with "functional" changes. It's very difficult to review such PRs and it most likely get rejected.
24+
* Do not add/remove vertical whitespace. Preserve the original style of the file you edit as much as you can.
25+
* Do not turn an already submitted PR into your development playground. If after you submitted PR, you discovered that more work is needed - close the PR, do the required work and then submit a new PR. Otherwise each of your commits requires attention from maintainers of the project.
26+
* If, however, you submitted a PR and received a request for changes, you should proceed with commits inside that PR, so that the maintainer can see the incremental fixes and won't need to review the whole PR again. In the exception case where you realize it'll take many many commits to complete the requests, then it's probably best to close the PR, do the work and then submit it again. Use common sense where you'd choose one way over another.
4627

4728
### Local setup for working on a PR
4829

4930
#### Clone the repository
50-
51-
- HTTPS: `git clone https://github.com/Nixtla/nixtla.git`
52-
- SSH: `git clone [email protected]:Nixtla/nixtla.git`
53-
- GitHub CLI: `gh repo clone Nixtla/nixtla`
31+
* HTTPS: `git clone https://github.com/Nixtla/nixtla.git`
32+
* SSH: `git clone [email protected]:Nixtla/nixtla.git`
33+
* GitHub CLI: `gh repo clone Nixtla/nixtla`
5434

5535
#### Set up a conda environment
36+
The repo comes with an `environment.yml` file which contains the libraries needed to run all the tests. In order to set up the environment you must have `conda` installed, we recommend [miniconda](https://docs.conda.io/en/latest/miniconda.html).
5637

57-
The repo comes with an `environment.yml` file which contains the libraries
58-
needed to run all the tests. In order to set up the environment you must have
59-
`conda` installed, we recommend
60-
[miniconda](https://docs.conda.io/en/latest/miniconda.html).
61-
62-
Once you have `conda` go to the top level directory of the repository and run
63-
the following lines (we recommend to use `python=3.10` for development,
64-
currently `python>=3.11` is not supported):
38+
Once you have `conda` go to the top level directory of the repository and run the following lines (we recommend to use `python=3.10` for development):
6539

6640
```
67-
conda env create -f environment.yml
41+
conda create -n nixtlats python=3.10
42+
conda activate nixtlats
43+
conda env update -f environment.yml
6844
```
6945

7046
#### Install the library
47+
Once you have your environment setup, activate it using `conda activate nixtlats` and then install the library in editable mode using `pip install -e ".[dev]"`
7148

72-
Once you have your environment setup, activate it using
73-
`conda activate nixtlats` and then install the library in editable mode using
74-
`pip install -e ".[dev]"`
49+
#### Set Up TimeGPT token
50+
This library uses `python-dotenv` for development. To set up your TimeGPT token, add the following lines to your `.env` file:
7551

76-
#### Install git hooks
52+
```
53+
TIMEGPT_TOKEN=<your token>
54+
```
7755

78-
Before doing any changes to the code, please install the git hooks that run
79-
automatic scripts during each commit and merge to strip the notebooks of
80-
superfluous metadata (and avoid merge conflicts).
56+
Please write to `[email protected]` if you're insterested in contributing to this project to get access to your TimeGPT token.
8157

58+
#### Install git hooks
59+
Before doing any changes to the code, please install the git hooks that run automatic scripts during each commit and merge to strip the notebooks of superfluous metadata (and avoid merge conflicts).
8260
```
8361
nbdev_install_hooks
8462
```
8563

8664
### Preview Changes
87-
88-
You can preview changes in your local browser before pushing by using the
89-
`nbdev_preview`.
65+
You can preview changes in your local browser before pushing by using the `nbdev_preview`.
9066

9167
### Building the library
92-
93-
The library is built using the notebooks contained in the `nbs` folder. If you
94-
want to make any changes to the library you have to find the relevant notebook,
95-
make your changes and then call:
96-
68+
The library is built using the notebooks contained in the `nbs` folder. If you want to make any changes to the library you have to find the relevant notebook, make your changes and then call:
9769
```
9870
nbdev_export
9971
```
10072

101-
### Linters
102-
103-
This project uses a couple of linters to validate different aspects of the code.
104-
Before opening a PR, please make sure that it passes all the linting tasks by
105-
following the next steps.
106-
107-
- `mypy nixtlats/`
108-
- `flake8 --select=F nixtlats/`
109-
11073
### Running tests
111-
112-
If you're working on the local interface you can just use
113-
`nbdev_test --n_workers 1 --do_print --timing`.
74+
If you're working on the local interface you can just use `nbdev_test --n_workers 1 --do_print --timing`.
11475

11576
### Cleaning notebooks
116-
117-
Since the notebooks output cells can vary from run to run (even if they produce
118-
the same outputs) the notebooks are cleaned before committing them. Please make
119-
sure to run `nbdev_clean --clear_all` before committing your changes. If you
120-
clean the library's notebooks with this command please backtrack the changes you
121-
make to the example notebooks `git checkout nbs/examples`, unless you intend to
122-
change the examples.
77+
Since the notebooks output cells can vary from run to run (even if they produce the same outputs) the notebooks are cleaned before committing them. Please make sure to run `nbdev_clean ` before committing your changes.
12378

12479
## Do you want to contribute to the documentation?
12580

126-
- Docs are automatically created from the notebooks in the `nbs` folder.
127-
- In order to modify the documentation:
128-
1. Find the relevant notebook.
129-
2. Make your changes.
130-
3. Run all cells.
131-
4. If you are modifying library notebooks (not in `nbs/examples`), clean all
132-
outputs using `Edit > Clear All Outputs`.
133-
5. Run `nbdev_preview`.
134-
6. Clean the notebook metadata using `nbdev_clean`.
81+
* Docs are automatically created from the notebooks in the `nbs` folder.
82+
* In order to modify the documentation:
83+
1. Find the relevant notebook.
84+
2. Make your changes.
85+
3. Run all cells.
86+
5. Run `nbdev_preview`.
87+
6. Clean the notebook metadata using `nbdev_clean`.
88+

0 commit comments

Comments
 (0)