Contributing to kanx π
May 13, 2026 Β· View on GitHub
First β thanks for considering a contribution! kanx is built to be
easy to fork, easy to extend, and boring to maintain. PRs of any
size are welcome, from typo fixes to new backends.
TL;DR
git clone https://github.com/Mattral/KANX
cd KANX
pip install -e ".[dev,api,torch,onnx,docs]"
bash scripts/test.sh # must stay green
Open a draft PR early. We'd rather discuss with code in front of us!
Project values (read this before sending a PR)
- One canonical surface per concept. If there's already a
train(), don't addfit_easy_v2(). Improve the existing one. - Fail loud at the boundary. Validate inputs in public functions; raise
ValueError/HTTPExceptionwith a precise message. - Tiny core dependency surface.
tensorflow + numpy + pyyamlonly. New deps go behind optional extras (api,torch,onnx,docs). - Maths gets a test. New numerical contracts β new test in
tests/test_layers.pyortests/test_properties.py. - Two backends, one semantics. Anything you add to
kanx.Xshould either:- have a parallel implementation in
kanx.torch.X, or - be explicitly documented as backend-specific.
- have a parallel implementation in
How to find something to work on
- π Good first issues β small, well-scoped tasks
- πΊοΈ
roadmap.mdβ P0 / P1 / P2 backlog - π Open bugs
- π¬ Discussions β design questions
High-leverage ideas (currently unowned)
- Adaptive grid update (
update_grid_from_samples) β P0 - HuggingFace Hub integration (
KAN.from_pretrained(...)) β P0 - Prometheus
/metricsmiddleware on the FastAPI service β P1 - JAX backend (third parallel surface) β P1
kanx.vizinteractive edge-function viewer β P2
Local setup
# 1. fork + clone + cd
# 2. install
pip install -e ".[dev,api,torch,onnx,docs]"
# 3. run tests (must stay green BEFORE you start)
bash scripts/test.sh
# 4. start the API locally
uvicorn api.app:app --reload --port 8000
# 5. build docs locally
mkdocs serve
Pull-request checklist
- One logical change per PR (mixing refactor + feature β split it)
-
bash scripts/test.shis green - New behaviour has a new test
-
ruff check src tests apiis clean -
CHANGELOG.mdupdated under[Unreleased] -
roadmap.mdupdated if you shipped a roadmap item - Public API change β update
README.md+ relevant doc indocs/ - PR description explains why, not just what
Coding conventions
- Imports sorted with
ruff format(PEP 8 / isort-compatible). - Type hints on public functions; internal helpers are optional.
- Docstrings in Google style; include a short example for new public APIs.
- No emoji in source files (README and docs are fine).
- No
printin library code β usekanx.utils.get_logger().
Reporting bugs
Open an issue with:
kanx.__version__, Python version, TF / PyTorch versions- Minimum reproducible snippet (β€ 20 lines)
- Expected vs actual behaviour
- Full stacktrace if it crashed
Security disclosures
Please don't open a public issue for security bugs. Email the maintainer directly (address in the project metadata) with details and a PoC.
License
By contributing you agree that your contributions are licensed under the
Apache License 2.0 β the same license as kanx.