Contributing to OpenSMC¶
We welcome all contributions to OpenSMC, whether you're fixing bugs, adding new control laws, or improving the documentation.
How to Contribute¶
1. Report Bugs & Request Features¶
If you find a bug or have an idea for a new feature, please open an issue on GitHub. For bug reports, please include: - A clear description of the issue. - Minimal code to reproduce the error. - Information about your environment (Python version, OS, etc.).
2. Submit Pull Requests¶
If you want to contribute code, follow these steps:
- Fork the Repository: Create your own fork of OpenSMC.
- Create a Branch: Use a descriptive name like
feature/new-reaching-laworbugfix/fix-eso-gain. - Write Code: Ensure your code follows the project's Modular Architecture.
- Add Documentation: If you're adding a new class, include docstrings for all methods.
- Run Tests: We use
pytestfor the Python package. - Submit PR: Open a pull request against the
mainbranch.
Code Standards¶
- Consistency: Maintain the dual Python/MATLAB parity whenever possible.
- Type Hinting: Use Python type hints for all method signatures.
- Docstrings: Use Google-style docstrings for
mkdocstringscompatibility. - Mathematics: Use LaTeX syntax in comments for complex derivations.
Adding New Components¶
When adding a new Surface, Reaching Law, or Controller:
- Inherit from the corresponding base class in opensmc.core.
- Add a corresponding implementation in the MATLAB + package.
- Include a minimal example in the docstring for automatic API documentation.
Thank you for helping us make OpenSMC the best toolbox for Sliding Mode Control!