PlanetProfile is open source software. See the LICENSE file and read the README.md file first. Please also review our community CODE_OF_CONDUCT.md.
We welcome input from everyone! If you are interested to contribute to PlanetProfile, please read this document carefully. If you have any questions, please contact the software Maintainer at the email listed below. PlanetProfile leadership all maintain this software on a part-time, volunteer basis. We endeavor to respond to any inquiry within 3 business days of receipt. If you don't receive a response by then, feel free to ping again.
- Owner: Dr. Steven D. Vance - [email protected]
- Maintainer: Dr. Marshall J. Styczinski - [email protected]
- Lead developers: Dr. Steven D. Vance - [email protected], Dr. Marshall J. Styczinski - [email protected], Dr. Mohit Melwani Daswani - [email protected]
PlanetProfile is designed for use in scientific applications. As such, we hold the software to a high standard for usability, compatibility, and accuracy. We review all contributions to ensure the quality of all improvements to the software. Proposed changes may be rejected if they cause runtime errors, physical inaccuracy, etc. In the event a change is rejected, we will work with the author to find a solution. Command line operations are assumed in the instruction below, but you can substitute another method if it has the same effect.
We have a Slack workspace that we use for development discussions. You will be invited to join the Slack once you express interest in contributing.
This software is in active development. For any issues you find, please use the GitHub issue reporting tool to document the problem and any solution you may be aware of. Including filenames and line numbers makes issues much easier to track, so please identify these whenever possible. To make sure your issue is addressed promptly, follow the checklist in the issue template. The template appears when you attempt to submit an issue.
As PlanetProfile is written at least partially in Matlab, it's up to us contributors to test that our commits function properly.
Before any and all commits or pull requests to Matlab code, change all CALC_NEW flags in config.m to 1, then run the test function PPtest in Matlab. This function must run without errors for your changes to be accepted.
If you would like to be considered for direct commit permissions, please contact Dr. Vance at the email listed above.
If you would like to propose changes to PlanetProfile, please use one of the following procedures.
Please read GitHub docs about pull requests before continuing.
- Fork the main repository to your own GitHub profile.
- On the main repository page, click the "Fork" button (usually at top-right).
- In your forked version, create a new branch with a name appropriate to the changes you wish to make.
- Download the forked version and apply (don't push yet) only the changes you wish to commit to the main repository.
- Change all CALC_NEW flags in config.m to 1, then run PPtest in Matlab. Fix any errors before continuing.
- Push your changes to the new branch in your forked version.
- On the web page for your forked version (at
https://github.com/
yourUsername/PlanetProfile
), click the "Pull Request" link just next to the colored "Code" button. - Write a descriptive commit message detailing the changes.
- A detailed comment is encouraged but not required. For example, describing the reasoning and content of your changes will make it easier for a maintainer to verify your contributions.
- A maintainer will review your commit and inform you through GitHub if further action is required. Thank you for contributing!
- Align with the repository.
- Save your local edits with
git stash
- Ensure your local version of the repository is up-to-date with
git pull
- Re-apply your local edits with
git stash pop
- Use
git status
to identify any files with merge conflicts. - Resolve merge conflicts by opening affected files and searching for
====
, which is used to separate the conflicting contributions.
- Save your local edits with
- Test your edits for runtime errors.
- Change all CALC_NEW flags in config.m to 1, then run PPtest in Matlab. Fix any errors before continuing.
- Apply your changes to the repository.
- Use
git add <filepath1> <filepath2> ...
to mark your desired changes for commit. - Again use
git status
to check that everything is as you intended it. - Use
git commit -m "Commit message"
to ready your changes for application. - Use
git push
to apply your changes.
- Use
The python version of PlanetProfile is listed on the Python Package Index, PyPI. Updating the package and release version require access permissions (which can be granted by Dr. Vance) and the following steps:
- Update documentation
- Navigate to the docs/ folder. From the top-level directory:
cd docs
- Generate HTML files:
rm -rf stubs/ && make clean && make html
. Make a note of any warnings. - Open
docs/_build/html/index.html
in a browser and confirm that everything looks as it should. - Resolve any warnings or issues with the documentation web pages before committing changes.
- Navigate to the docs/ folder. From the top-level directory:
- Create pypi package
- Delete previous package files from dist/ folder.
- Update version number in both
setup.py
andPlanetProfile/Utilities/PPverNum.txt
- Construct the package from
setup.py
andMANIFEST.in
instructions:python -m build
- Upload pypi package and GitHub/Zenodo release
- Upload to PyPI:
python -m twine upload dist/* --verbose
- For Username, enter verbatim:
__token__
and hit enter. - For Pass, copy to clipboard and paste into the terminal your PyPI API token and hit enter. The token is what you saved during your PyPI account setup.
- For Username, enter verbatim:
- Upload GitHub/Zenodo release:
- Navigate to https://github.com/vancesteven/PlanetProfile/releases/new
- Drag-and-drop or upload the new
dist/PlanetProfile-#.#.#.tar.gz
file - Enter the new version number, preceded by "v", in the "Choose a tag" menu at the top. Target should be "main".
- Give the release a title that briefly indicates what's new in this version.
- Add a couple sentences describing the changes in slightly more detail in the "Describe this release" box. See previous releases for examples.
- Upload to PyPI:
- Update the mirror in the NASA-planetary-science org
- Navigate to the mirror repo local directory (e.g.
cd ~/NASApp/
) - Update the mirror:
git remote update && git push --mirror
- Navigate to the mirror repo local directory (e.g.
Going through these steps for the first time requires some initial setup. Follow the steps below the first time you are ready to create a new release. You will need write permissions for:
- The main repo at https://github.com/vancesteven/PlanetProfile
- The PyPI package at https://pypi.org/project/PlanetProfile/
- The mirror repo at https://github.com/NASA-Planetary-Science/PlanetProfile
Contact project personnel to get write permissions if required.
- Create an account on PyPI: https://pypi.org/account/register/
- Confirm your account by email
- Generate and save (in a safe place!) your upload authentication token. You will need it every time you update the package on PyPI.
- Ensure pip is the latest version and that build and twine are installed:
pip install --upgrade pip build twine
Install prerequisites with pip: pip install sphinx sphinxcontrib-matlabdomain sphinxcontrib.apidoc sphinx-rtd-theme myst-parser
- Sphinx is a tool for reading docstrings in the code and converting them to documentation pages.
- sphinxcontrib-matlabdomain provides support for Matlab docstrings.
- sphinx-rtd-theme provides the 'sphinx_rtd_theme' option (note the underscores) for the Read-the-Docs theme
- myst-parser provides a conversion tool for parsing README files written in Markdown (.md files)
- Navigate to where you want to local GitHub files to live (e.g. your home directory)
- Clone a mirror of the main repo:
git clone --mirror [email protected]:vancesteven/PlanetProfile.git
- Rename the mirror to avoid conflicts with the main repo. Recommended:
mv PlanetProfile.git NASApp
- Navigate to the new folder, e.g.
cd NASApp
- Edit the config file using
git config -e
to point refs from the main repo to the mirror. That is:
Change the line
fetch = +refs/*:refs/*
to instead be
fetch = +refs/tags/*:refs/tags/*
fetch = +refs/heads/*:refs/heads/*
push = +refs/tags/*:refs/tags/*
push = +refs/heads/*:refs/heads/*
pushurl = [email protected]:NASA-Planetary-Science/PlanetProfile.git
Then save and exit.
In the event of a major restructure, Sphinx is not well set up to reformat the docs without a lot of manual intervention. Here are the steps to redraw the documentation pages from scratch.
- Install sphinx prerequisites and extensions listed above.
Note: The current package release ofsphinxcontrib.apidoc
does not support user-defined templates. To support templates, replace__init.py__
andext.py
in your localsite-packages
folder forsphinxcontrib/apidoc
with the files at https://github.com/itsmoosh/apidoc/tree/master/sphinxcontrib/apidoc. - Copy any custom or edited documentation files, including:
conf.py
index.rst
readme.rst
requirements.txt
pythonModules.txt
.gitignore
.nojekyll
misc/
and its contentstemplates/
and its contentsSPICE/
and its contents
- Delete the entire
docs
directory - Navigate to the repo top-level directory and run the following command:
sphinx-quickstart docs
- Accept the default and do not separate source and build directories
- Enter
PlanetProfile
for the project name - Enter
Vance
for the author name (we will overwrite this with conf.py in a moment, but we have to write something) - Accept the defaults for version number and language
- Delete the unnecessary
docs/_templates
directory - Copy the custom files you saved back into the
docs/
directory, replacing the existing files - Navigate into the
docs
directory withcd docs
and generate pages withmake html
Subsequent builds need only run rm -rf stubs/ && make clean && make html
from the docs/
directory.