Skip to content

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:

  1. Fork the Repository: Create your own fork of OpenSMC.
  2. Create a Branch: Use a descriptive name like feature/new-reaching-law or bugfix/fix-eso-gain.
  3. Write Code: Ensure your code follows the project's Modular Architecture.
  4. Add Documentation: If you're adding a new class, include docstrings for all methods.
  5. Run Tests: We use pytest for the Python package.
  6. Submit PR: Open a pull request against the main branch.

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 mkdocstrings compatibility.
  • 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!