Contribute#
Thank you for your interest in contributing to SeismoViz! This guide will help you get started with contributing code, following our coding standards, and understanding our development practices.
Setting up your development environment#
Fork the repository: Visit the SeismoViz GitHub repository and click the “Fork” button to create your own copy.
Clone your fork:
git clone https://github.com/gabrielepaoletti/seismoviz.git cd seismoviz
Set up a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use: venv\Scripts\activate
Install development dependencies:
pip install -e ".[dev]"
Development workflow#
Create a new branch for your feature or bugfix:
git checkout -b feature-name
Make your changes: Write your code following our coding standards (see below).
Add tests: Ensure that your code is properly tested.
Update documentation: Add or update documentation as needed.
Run tests locally:
pytest
Commit your changes:
git add . git commit -m "Your descriptive commit message"
Push your branch to GitHub:
git push origin feature-name
Open a Pull Request: Go to the SeismoViz repository and open a pull request from your branch.
Coding standards#
We follow these standards for our code:
Code style: We use PEP 8 for code style. Please use black for automatic formatting:
black .Type hints: Use type hints whenever possible.
Docstrings: Write docstrings in NumPy style for all public functions, classes, and methods.
def function(param1, param2): """ Short description of the function. Parameters ---------- param1 : type Description of param1 param2 : type Description of param2 Returns ------- type Description of return value """ return result
Import order: Group imports in the following order, with a blank line between each group: 1. Standard library imports 2. Related third-party imports 3. Local application/library specific imports
Testing#
Write unit tests for all new functionality.
Ensure that your tests cover both normal use cases and edge cases.
Make sure all tests pass before submitting a pull request.
Documentation#
Update documentation for any new features or changes to existing functionality.
Follow the RST formatting used throughout our documentation.
Include examples where appropriate.
Pull request process#
Ensure all tests pass.
Update the README.md and documentation if needed.
The PR should be associated with an issue when appropriate.
Your PR will be reviewed by maintainers who may request changes.
Once approved, a maintainer will merge your contribution.
Questions?#
If you have any questions or need help with your contribution, feel free to:
Open an issue on GitHub
Reach out to the maintainers
Join our community channels
Thank you for contributing to SeismoViz!