Contributing to neuralset¶
Thanks for your interest in contributing! Before diving in, see the design philosophy for the principles behind neuralset’s API (pydantic everywhere, lazy evaluation, the event abstraction).
Ways to Contribute¶
Bug reports — open an issue with a minimal reproducer.
Bug fixes — include a regression test.
New datasets or features — please open an issue first to discuss.
Documentation — typo fixes, examples, tutorials are always welcome.
Fork & Pull-Request Workflow¶
Fork the repository on GitHub and clone your fork locally.
Create a branch from
main(or the current dev branch):git checkout -b my-feature
Make your changes — follow the code style below.
Run the checks before committing:
cd neuralset-repo ruff check neuralset/ mypy neuralset/ pytest neuralset/ -x -q
Commit — pre-commit hooks will auto-format with black/isort and lint with ruff. If a hook fails, fix the issue and commit again.
Push your branch and open a Pull Request against the upstream repo.
A reviewer will check code quality, test coverage, and API consistency.
Tip
Keep PRs focused — one logical change per PR. PRs are squash-merged; intermediate commit messages don’t matter.
Reporting & Fixing Bugs¶
Search first — check existing GitHub issues to avoid duplicates.
File a bug with: a clear title, minimal reproduction steps, expected vs. actual behaviour, and your environment (Python version, OS, package version).
Fix a bug — if you want to fix it yourself:
Write a failing test that reproduces the bug.
Implement the fix.
Verify the test now passes.
Open a PR referencing the issue.
Code Quality & Pre-Commit Hooks¶
Pre-commit hooks run automatically on git commit:
Hook |
What it does |
|---|---|
black |
Auto-formats Python code (line length, quotes, etc.) |
isort |
Sorts and groups import statements |
ruff |
Fast linter — catches style issues, unused imports, etc. |
You can also run them manually:
cd neuralset-repo
ruff check neuralset/ # lint
mypy neuralset/ # type check
pytest neuralset/ -x -q # tests
To run hooks on all files (useful before a PR):
pre-commit run --all-files
All public APIs must have type annotations. Use tp.ClassVar for class
constants, tp.Literal for string enums, pydantic BaseModel fields
for configuration.
Use of Generative AI¶
Contributors are welcome to use AI tools (Copilot, ChatGPT, etc.) as aids, subject to these rules:
You are responsible for all code you submit. Review and understand every line before opening a PR.
Do not submit AI output you don’t understand. If you can’t explain a change, don’t submit it.
No AI bots interacting with the project. Automated agents must not open issues, submit PRs, post comments, or review code on behalf of contributors.
Legal¶
Contributor License Agreement¶
To accept your pull request we need a signed CLA. You only need to do this once for all Meta open-source projects: https://code.facebook.com/cla
Security¶
Meta has a bounty program for safe disclosure of security bugs. Report security issues through that process — do not file a public issue.
Code of Conduct¶
See Code of Conduct.
License¶
By contributing, you agree that your contributions will be licensed under the LICENSE file in the root directory of this source tree.