Contributing to stellarphot
#
Setup#
These steps typically only need to be done once.
To setup
stellarphot
for development, first create your own copy in GitHub by forking the repository.Clone your fork to your local machine.
Add the main
stellarphot
repository as a remote calledupstream
.
Make a development environment#
These steps typically only need to be done once. If something goes wrong with the dev environment, you may need to delete it and start over.
Create a new conda environment for
stellarphot
. You can call it whatever you want. For example, you might call itstellarphot-dev
. The command to create the environment would be:# The couple of packages listed below take care of some dependencies # that would otherwise need to be compiled. mamba create -n stellarphot-dev python=3.11 ccdproc batman-package
Activate the environment:
mamba activate stellarphot-dev
Change directory into the folder with your clone of
stellarphot
. Installstellarphot
in development mode with the dependencies needed for testing:pip install -e .[test]
Install the pre-commit hooks – these are checks run before every commit:
pre-commit install
Steps when Contributing#
These typically need to be done every time you make a contribution.
Create a new branch for your contribution that is based on the branch
upstream/main
. Give the branch a descriptive name. For example, if you are adding a new feature, you might call the branchadd-new-feature
. These git command to do this would begit checkout -b add-new-feature upstream/main
.Write a test for your contribution. This should be a new test in the appropriate
tests
directory. If you are adding a new feature, you should add a new test file. If you are fixing a bug, you should add a new test to an existing test file. The test should be written using thepytest
framework. See thetests
directories for examples. Make sure your test fails before you make your contribution.Make your contribution. This could be a new feature, a bug fix, or a documentation update. Make sure your test passes after you make your contribution.
Commit your contribution to your branch. Your commit message should be short but descriptive. For example, if you are adding a new feature, you might use a commit message like
Add new feature to do X
.Push your branch to your fork on GitHub.
Create a pull request from your branch to the
main
branch of the mainstellarphot
repository. Give the pull request a descriptive name and description. If your pull request fixes an issue, reference the issue in the description using the#
symbol. For example, if your pull request fixes issue 123, you would writeFixes #123
in the description.Wait for your pull request to be reviewed. If there are any issues, you may need to make additional commits to your branch to address them. If you need to make additional commits, make sure you push them to your fork on GitHub. The pull request will be updated automatically.