General information on how to contribute to any Project Pythia repository may be found in the Contributing to Project Pythia guide.
As GitHub pull requests are an important part of contributing to Pythia, this guide will cross-reference tutorials from our chapters on Getting Started with GitHub.
A quick and easy way to find the Pythia Foundations source repository on GitHub while you are browsing the book is to look for the GitHub Octocat logo near the top right of each page. This will link directly to our main source repository on GitHub.
In order to open issues or create pull requests to suggest changes, you must have a free GitHub account. This guide is strictly for Pythia Foundations; for general Project Pythia contribution guidelines, see the main guide for Contributing to Project Pythia.
To quickly provide feedback about minor issues without the use of GitHub, you can also use this Google Form.
Contributing a new Jupyter notebook¶
If you’d like to contribute a Jupyter Notebook to these materials, please reference our Project Pythia Notebook Template viewable on the next page. This template is available to you in appendix/template.ipynb if you’ve cloned the source repository, or available as a download directly from GitHub.
Building the site¶
Create a conda environment¶
The first time you check out this repository, run:
conda env update -f environment.ymlThis will create or update the dev environment (pythia-book-dev).
Install pre-commit hooks¶
This repository includes pre-commit hooks (defined in .pre-commit-config.yaml). To activate/install these pre-commit hooks, run:
conda activate pythia-book-dev
pre-commit installThis is also a one-time step.
NOTE: The pre-commit package is already installed via the pythia-book-dev conda environment.
Building the book locally¶
To build the book locally, run the following:
conda activate pythia-book-dev
myst start --executeFinally, you can view the book by opening the localhost link that should be generated in your terminal.
Updating the list of authors¶
The full author list for Pythia Foundations is displayed on the How to Cite page.
To add, change, or update the author list, edit the frontmatter of the markdown source file for that page. We typically identify authors using an id tag that matches the author’s GitHub username. The source of truth for these author id keys is maintained upstream in a project-wide configuration file. See the MyST docs on authors for more guidance on author metadata.
The CITATION.cff file¶
The file CITATION.cff that lives at the root of the repository is interpreted by GitHub, Zenodo, and other services. It should be regenerated any time there is a change in author metadata.
To regenerate CITATION.cff, simply run this command from the root of the pythia-foundations repository:
myst build preamble/how-to-cite.md --cffThe updated CITATION.cff can then be committed to a branch and a pull request can be opened as usual.
Keeping your dev environment up to date¶
It’s good practice to update the packages in your pythia-book-dev conda environment frequently to their latest versions, especially if it’s been a while since you used it. If the myst start --execute command above generates error messages, that is a good indication that your conda environment may be out of date.
To update all packages in the currently activated environment to their latest versions, do this:
conda update --all