Python code packaging for scientific software¶
By Jo Bovy
(last changed August 04, 2021, rev. 9d76abf; last built November 04, 2021)
This is a brief set of notes with an overview of the steps involved in developing, publishing, and maintaining a scientific software package. The notes focuses on current best practices and the different tools available to build, release, and maintain a scientific software package.
A PDF version of these notes is available here.
- 1. Introduction: What makes a good scientific software package?
- 2. The basic structure of a Python package
- 3. git and GitHub: version control and social open-source development
- 4. Documenting your code and hosting the documentation online
- 4.1. Basics of good documentation
- 4.2. Python docstrings
- 4.3. Using
sphinxto write and generate documentation for your package
- 4.4. A brief tour of reStructuredText
- 4.5. Including docstrings into the
- 4.6. Including
jupyternotebooks as part of your documentation
- 4.7. Automatically building and hosting your documentation on
- 5. Testing your code
- 6. Automatically building and testing your code: continuous integration
- 7. Releasing your package
All of the code snippets and examples in these notes are being shared under a CC0 1.0 Public Domain license, so you can re-use and re-mix them in your own work. Otherwise, the text is shared under a CC BY-NC-ND 4.0 International Creative Commons License, meaning that you may distribute the work in full only, you are not allowed to modify it in any way, and you may not use it for commercial means or to gain monetary compensation (note that this summary is no substitute for the full license terms).