Instructions for Developers#

This file presents instructions for Pystra developers.

Create working repository with developer install#

  1. Fork Pystra GitHub repository

  2. Clone repo

    git clone <forked-repo>
    
  3. Create new Pystra developer environment

    conda create -n pystra-dev python=3.10
    
  4. Activate developer environment

    conda activate pystra-dev
    
  5. Change directory to pystra fork

  6. Install developer version

    pip install -e .
    
  7. Install depedencies

    conda install -c anaconda pytest
    conda install -c anaconda sphinx
    conda install -c conda-forge black
    pip install sphinx_autodoc_typehints
    pip install nbsphinx
    pip install pydata_sphinx_theme
    
  8. Add Pystra as upstream

    git remote add upstream https://github.com/pystra/pystra.git
    

Develop and create pull-request (PR)#

  1. Create new branch

    git checkout -b <new-branch>
    
  2. Pull updates from Pystra main

    git pull upstream main
    
  3. Develop package

  4. [If applicable] Create unit tests for pytest.

    • Store test file in ./tests/<test-file.py>.

  5. [If applicable] Create new example notebook.

    • Store notebook in ./docs/source/notebooks/<tutorial.ipynb>.

    • Index notebook in ./docs/source/tutorial.rst

  6. [If applicable] Add new dependencies in ./setup.cfg

  7. Build documentation

    • Change directory to ./docs/

    • make clean

    • make html

    • xdg-open build/html/index.html

  8. Update version number in the following files

    • ./docs/source/index.rst

    • ./pystra/__init__.py

  9. Stage changes; commit; and push to remote fork

  10. Go to GitHub and create PR for the branch