Skip to content

Commit b4f95e5

Browse files
committed
DOC: add contributor docs
1 parent 5bde2c6 commit b4f95e5

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

docs/contributing.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributing
2+
3+
Contributions are welcome from any "array-consuming" library contributors who
4+
have found themselves writing private array-agnostic functions in the process of
5+
converting code to consume the standard!
6+
7+
## How to contribute a function
8+
9+
- Add the implementation of your function to `src/array_api_extra/_funcs.py`.
10+
- Ensure that your function includes type annotations and a
11+
[numpydoc-style docstring](https://numpydoc.readthedocs.io/en/latest/format.html).
12+
- Add your function to `__all__` at the top of the file.
13+
- Import your function to `src/array_api_extra/__init__.py` and add it to
14+
`__all__` there.
15+
- Add a test class for your function in `tests/test_funcs.py`.
16+
- [Make a PR!](https://github.com/data-apis/array-api-extra/pulls)
17+
18+
## Development workflow
19+
20+
If you are an experienced contributor to Python packages, feel free to develop
21+
however you feel comfortable! However, if you would like some guidance,
22+
development of array-api-extra is made easy with
23+
[Pixi](https://pixi.sh/latest/):
24+
25+
- [Clone the repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)
26+
at <https://github.com/data-apis/array-api-extra>.
27+
- `cd array-api-extra`.
28+
- [Install Pixi](https://pixi.sh/latest/#installation).
29+
- To enter a development environment:
30+
31+
```
32+
pixi shell -e dev
33+
```
34+
35+
- To run the tests:
36+
37+
```
38+
pixi run test
39+
```
40+
41+
- To build the docs locally:
42+
43+
```
44+
pixi run docs
45+
```
46+
47+
- To install a [pre-commit](https://pre-commit.com) hook and run the lint suite:
48+
49+
```
50+
pixi run lint
51+
```
52+
53+
- To enter an interactive Python prompt:
54+
55+
```
56+
pixi run ipython
57+
```
58+
59+
- To run individual parts of the lint suite separately:
60+
61+
```
62+
pixi run pre-commit
63+
pixi run pylint
64+
pixi run mypy
65+
```
66+
67+
Alternative environments are available with a subset of the dependencies and
68+
tasks available in the `dev` environment:
69+
70+
```
71+
pixi shell -e docs
72+
pixi shell -e test
73+
pixi shell -e lint
74+
```

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
:maxdepth: 2
55
:hidden:
66
api-reference.md
7+
contributing.md
78
```
89

910
This is a library housing "array-agnostic" implementations of functions built on

0 commit comments

Comments
 (0)