Skip to content

Commit 720cc6f

Browse files
committed
📝🔧 start adressing recommendations from Sebastian, see #5
1 parent 6615d19 commit 720cc6f

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

Contributing.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Contributing code
2+
3+
Install the code with development dependencies:
4+
5+
```bash
6+
pip install -e '.[dev]'
7+
```
8+
9+
## Format code and sort imports
10+
11+
```bash
12+
black .
13+
isort .
14+
```
15+
16+
## lint code
17+
18+
```bash
19+
ruff check .
20+
```
21+
22+
## Run tests
23+
24+
```bash
25+
pytest
26+
```
27+
28+
## Sync notebooks with jupytext
29+
30+
For easier diffs, you can use jupytext to sync notebooks in the `docs/tutorial` directory with the percent format.
31+
32+
```bash
33+
jupytext --sync docs/tutorial/*.ipynb
34+
```
35+
36+
This is configured in the [`.jupytext`](docs/tutorial/.jupytext) file in that directory.

docs/tutorial/.jupytext

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
# all notebooks in this directory are in the percent format
1+
# all notebooks in this directory are synced percent format when typing
2+
# (jupytext is a dev dependency)
3+
# jupytext --sync *.ipynb
4+
# or from root directory
5+
# jupytext --sync docs/api_examples/*.ipynb
26
formats = "ipynb,py:percent"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ docs = [
4343
"sphinx-copybutton",
4444
]
4545
# local development options
46-
dev = ["black[jupyter]", "ruff", "pytest"]
46+
dev = ["black[jupyter]", "ruff", "pytest", "isort", "jupytext"]
4747

4848
[tool.ruff]
4949
# https://docs.astral.sh/ruff/rules/#flake8-bandit-s

0 commit comments

Comments
 (0)