Thank you for considering contributing to ZOSPy! Before contributing, please read these guidelines, so we can process your contribution as quickly as possible.
ZOSPy aims to make interaction between Python and Zemax/Ansys OpticStudio as easy as possible by providing a Pythonic interface for the OpticStudio API. Any contributions serving this goal, or aiding optical simulations in OpticStudio, are welcome. If you don't know what to contribute, here are some ideas that are definitely welcome:
- Examples of various kinds of optical systems (in
examples/
). These can be supplied as Python scripts, but Jupyter Notebooks are preferred; - Implementation of additional analyses (in
zospy/analyses
). Please refer to other analyses on how to implement them. If you add a new analysis, please include unit tests as well; - Implementation of additional solvers (in
zospy/solvers
); - Compatibility checks. If you are using a version of OpticStudio that is not listed in the README, please run the unit tests and update the README accordingly.
- Please format your docstrings according to numpydoc.
- Additional code styling is automatically applied when running the tests using
tox
.
For development, additional dependencies are necessary for unit testing etc. They can be installed by running
pip install .[dev]
in the project directory.
Add your contribution in a new feature branch. When contributing an analysis, please include unit tests.
Since automated testing using GitHub Actions is not possible due to the dependency on OpticStudio, we request you to run all unit tests prior to opening a Pull Request. Testing has been automated for multiple Python versions and can be initiated by running
tox
in the project directory. More information about running the unit tests can be found here. If you run the tests for a previously untested version of OpticStudio or added tests for analysis wrappers, do not forget to generate reference data for these tests. More information about this can be found in the test documentation.
Open a Pull Request, wait for our suggestions, and get your contribution merged!