Codebase quality and consistency
This guide outlines the rules and tools used to ensure quality and consistency in Ersilia's codebase. By adhering to these practices, we aim to maintain a high standard of code readability, maintainab
Contributing
When contributing to the codebase, ensure the following:
Code Style: Run Ruff locally to check for compliance:
Documentation: All public methods and classes must have a NumPy-style docstring, including an
Examples
section for public classes.Testing: Ensure all tests pass before committing changes.
By following these guidelines, we can maintain a robust and consistent codebase. If you have any questions or need assistance, please reach out to the team lead.
Standard Overview
Our pipeline includes the following tools:
Ruff: A fast Python linter and formatter.
Pre-commit Hooks: Ensures code compliance with defined rules before committing.
Docstring Standards: Public methods and classes use the NumPy docstring convention.
1. Pre-commit Hooks
Pre-commit hooks are configured to run Ruff and enforce the rules automatically before commits. Ensure the following steps are followed:
Install pre-commit hooks:
Before committing, the hooks will:
Lint code using Ruff.
Check for formatting issues.
Fix fixable issues where applicable.
2. Docstring Standards
We follow the NumPy docstring convention for all public methods and classes. Below is an example for public methods and classes:
Example Docstring for a Public Method
Example Docstring for a Public Class
Last updated
Was this helpful?