Contributing to ARIELΒΆ
Thank you for your interest in contributing to ARIEL β an open-source evolutionary robotics framework. ARIEL is licensed under GPL-3.0 and welcomes contributions of all kinds: bug reports, feature requests, documentation improvements, and pull requests.
Table of ContentsΒΆ
ResourcesΒΆ
Resource |
Link |
|---|---|
Source code |
|
Issue tracker |
|
Changelog |
Code of ConductΒΆ
This project follows the Contributor Covenant Code of Conduct. By participating, you agree to uphold these standards. Violations may be reported to the project maintainers.
Reporting BugsΒΆ
Report bugs via the Issue Tracker.
A good bug report answers all of the following:
OS & Python version β e.g. Ubuntu 22.04, Python 3.12.3
What you did β minimal code snippet to reproduce the problem
What you expected β the behaviour you anticipated
What happened instead β exact error message or observed behaviour
The fastest path to a fix is a minimal reproducible example or a failing test case.
Requesting FeaturesΒΆ
Open a GitHub Issue and describe:
The problem the feature would solve
A rough API sketch or usage example
Any relevant prior art or references
It is recommended to discuss the idea in an issue before writing code, so the approach can be validated early.
Development EnvironmentΒΆ
PrerequisitesΒΆ
Tool |
Purpose |
Install |
|---|---|---|
Python β₯ 3.12.9 |
Runtime |
|
Package & environment manager |
|
|
Task runner / test sessions |
|
|
Git hook manager |
|
InstallationΒΆ
Clone the repository and install the package in editable mode with all development dependencies:
$ git clone https://github.com/ci-group/ariel.git
$ cd ariel
$ uv venv
$ uv sync
Verify the installation:
$ uv run ariel/examples/a_mujoco/0_mujoco_launcher.py
Project StructureΒΆ
ariel/
βββ src/ariel/ # Main package source
β βββ body_phenotypes/ # Robot morphology (robot systems, CPPN-NEAT)
β βββ ec/ # Evolutionary computation engines, operators etc
β βββ simulation/ # Physics simulation (MuJoCo)
β βββ parameters/ # Configuration and parameter management
β βββ utils/ # Shared utilities
β βββ visualisation/ # Dashboard and visualisation tools
βββ tests/
β βββ unit/ # Unit tests
β βββ functional/ # Functional / integration tests
βββ docs/ # Sphinx documentation
β βββ source/ # RST/Markdown source pages
βββ examples/ # Standalone runnable examples
βββ .github/workflows/ # CI/CD pipelines
βββ pyproject.toml # Project metadata and tool config
βββ ruff.toml # Ruff linter/formatter config
βββ mypy.ini # MyPy type checker config
βββ pyrightconfig.json # Pyright type checker config
βββ noxfile.py # Nox session definitions
A general heuristic for package dependencies: if adding a feature would introduce a dependency from one ARIEL sub-package to another, reconsider the design. Refer to the package diagram in the documentation for the intended dependency direction.
Code Style & QualityΒΆ
ARIEL enforces a consistent code style using Ruff for both linting and formatting.
Key formatting rulesΒΆ
Setting |
Value |
|---|---|
Target Python |
3.12.9 |
Line length |
80 characters |
Quote style |
Double quotes |
Indent |
4 spaces |
Line endings |
LF ( |
Docstring convention |
NumPy |
All linting rules (ALL) are enabled except a small set of acknowledged exceptions (see ruff.toml).
Running the formatterΒΆ
$ uv run ruff format .
Running the linterΒΆ
$ uv run ruff check . --fix
Auto-fixes are applied automatically; review the diff before committing.
Type CheckingΒΆ
All public API code must be fully typed. ARIEL runs two type checkers in strict mode:
Both run in strict mode. Do not use # type: ignore comments without a clear explanation.
ARIEL ships a py.typed marker (PEP 561), so downstream packages can consume its type information.
Writing DocstringsΒΆ
All public functions, classes, and methods must have a docstring following the NumPy style:
def evaluate(robot: Robot, config: SimConfig) -> float:
"""Evaluate the fitness of a robot in simulation.
Parameters
----------
robot : Robot
The robot morphology and controller to evaluate.
config : SimConfig
Simulation configuration (duration, timestep, etc.).
Returns
-------
float
Scalar fitness value. Higher is better.
Raises
------
SimulationError
If the physics engine fails to initialise.
"""
Docstrings are validated by pydoclint (NumPy style) via pre-commit. Code examples inside docstrings are auto-formatted by Ruff.
TestingΒΆ
Running the test suiteΒΆ
$ nox
List all available Nox sessions:
$ nox --list-sessions
Run only unit tests:
$ nox --session=tests
Run tests directly with pytest (faster iteration):
$ uv run pytest tests/unit/
$ uv run pytest tests/functional/
Writing testsΒΆ
Place unit tests in
tests/unit/and functional tests intests/functional/.Use pytest conventions β no custom test classes unless necessary.
Prefer small, focused tests with descriptive names.
assertstatements are allowed in tests (theS101rule is disabled in test files).
DocumentationΒΆ
The documentation is built with Sphinx, the Furo theme, and MyST Parser for Markdown support. API reference pages are generated automatically via AutoAPI.
Building docs locallyΒΆ
$ nox --session=docs
This cleans the docs/_build/ and docs/_autoapi/ directories, then launches a live-reload server at http://localhost:8000.
Documentation guidelinesΒΆ
All public symbols must have a complete NumPy-style docstring (see Writing Docstrings).
New features should include a tutorial page or example notebook in
docs/source/orexamples/.If your changes add or remove a public API, update the relevant
.mdsource page.Documentation is deployed automatically to GitHub Pages on every push to
main.
Submitting a Pull RequestΒΆ
Open an issue first for non-trivial changes to align on the approach before writing code.
Fork the repository and create a branch from
main:$ git checkout -b feat/my-feature
Make your changes, ensuring:
The full test suite passes (
nox)Code coverage is maintained
New public APIs are fully typed and documented
Push your branch and open a Pull Request against
main.The PR description should explain what changed and why.
PR checklistΒΆ
Tests pass (
nox)Code coverage (
uv run pytest --cov=ariel)Type checks pass (
uv run mypy src/anduv run pyright)All new public symbols have NumPy-style docstrings
Documentation updated if API changed
PR description explains the motivation
Merging policy:
Into
main: use Squash and Merge to keep a clean linear history.
Commit Message GuidelinesΒΆ
ARIEL follows a conventional commit style to make the history readable:
<type>(<scope>): <short summary>
<optional body>
Types: feat, fix, docs, refactor, test, chore, perf
Examples:
feat(ec): add restart-from-database support for EC engines
fix(simulation): correct MuJoCo worker timestep initialisation
docs(contributing): expand PR checklist and type-checking section
test(body_phenotypes): add coverage for CPPN-NEAT edge cases
Keep the summary line under 72 characters. Use the body to explain why the change was made, not what β the diff already shows the what.