mirror of
https://github.com/wassname/jaxtyping.git
synced 2026-08-25 11:19:16 +08:00
This required quite a lot of refactoring! JAX supports virtual subclass registration (its metaclass is ABCMeta) but NumPy does not, so we have to actually subclass `np.ndarray`. Simple stuff like __base__ hacking fails due to deallocator conflicts.
56 lines
1.4 KiB
Markdown
56 lines
1.4 KiB
Markdown
# Contributing
|
|
|
|
Contributions (pull requests) are very welcome! Here's how to get started.
|
|
|
|
---
|
|
|
|
First fork the library on GitHub.
|
|
|
|
Then clone and install the library in development mode:
|
|
|
|
```bash
|
|
git clone https://github.com/your-username-here/jaxtyping.git
|
|
cd jaxtyping
|
|
pip install -e .
|
|
```
|
|
|
|
Then install the pre-commit hook:
|
|
|
|
```bash
|
|
pip install pre-commit
|
|
pre-commit install
|
|
```
|
|
|
|
These hooks use Black and isort to format the code, and flake8 to lint it.
|
|
|
|
Now make your changes. Make sure to include additional tests if necessary.
|
|
|
|
Next verify the tests all pass:
|
|
|
|
```bash
|
|
pip install pytest cloudpickle
|
|
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
|
|
pytest
|
|
```
|
|
|
|
Then push your changes back to your fork of the repository:
|
|
|
|
```bash
|
|
git push
|
|
```
|
|
|
|
Finally, open a pull request on GitHub!
|
|
|
|
## Contributor License Agreement
|
|
|
|
Contributions to this project must be accompanied by a Contributor License
|
|
Agreement (CLA). You (or your employer) retain the copyright to your
|
|
contribution; this simply gives us permission to use and redistribute your
|
|
contributions as part of the project. Head over to
|
|
<https://cla.developers.google.com/> to see your current agreements on file or
|
|
to sign a new one.
|
|
|
|
You generally only need to submit a CLA once, so if you've already submitted one
|
|
(even if it was for a different project), you probably don't need to do it
|
|
again.
|