Setting Up As A New Developer
Use this page when you are preparing a local checkout for TARDIS development. It gathers the one-time setup steps that used to be spread across the Git, code-style, and codebase-structure pages.
Set Up GitHub Access
Create a GitHub account at https://github.com if needed.
Configure write access with SSH keys.
Use GitHub Help’s SSH key instructions: https://help.github.com/articles/generating-ssh-keys
Fork And Clone TARDIS
You only need to fork once for each package you want to contribute to.
Log into GitHub.
Go to the TARDIS GitHub home page.
Click the fork button.
Clone your fork:
git clone git@github.com:your-user-name/tardis.git cd tardis
Check branches:
git branch -a
Check remotes:
git remote -v
At this point, origin should point to your GitHub fork.
Connect Your Fork To Upstream
Add the main TARDIS repository as upstream:
git remote add upstream https://github.com/tardis-sn/tardis.git
The upstream name is the convention used for the main TARDIS repository. The
workflow uses the HTTPS URL for upstream because it is read-only by default for
most contributors and avoids accidental writes to the main repository.
Confirm the remotes:
git remote -v show
Expected output should include:
upstream https://github.com/tardis-sn/tardis.git (fetch)
upstream https://github.com/tardis-sn/tardis.git (push)
origin git@github.com:your-user-name/tardis.git (fetch)
origin git@github.com:your-user-name/tardis.git (push)
Install TARDIS In Development Mode
From the repository root, run:
pip install -e .
TARDIS is designed to be usable from the source tree. An editable install makes
tardis import from your clone, so local edits are available immediately in new
Python sessions.
After installation, confirm that Python imports from your checkout:
python -c "import tardis; print(tardis.__file__)"
Prepare Your Local Development Fork
This path prepares a new contributor to work on TARDIS locally.
Set up a Python environment. The original developer workflow recommends Anaconda and refers readers to the installation guide.
Create a GitHub account if you do not already have one.
Configure your GitHub account for write access, including SSH keys.
Fork the TARDIS repository from the TARDIS GitHub home page.
Clone your fork:
git clone git@github.com:your-user-name/tardis.git cd tardis
Inspect local and remote branches:
git branch -a git remote -v
Add the main TARDIS repository as
upstream:git remote add upstream https://github.com/tardis-sn/tardis.git
Confirm the remote configuration:
git remote -v show
Expected remotes include
origin, pointing to your fork, andupstream, pointing tohttps://github.com/tardis-sn/tardis.git.Install TARDIS in development mode:
pip install -e .
This installs TARDIS so imports use your repository clone regardless of your working directory. Edits in your clone are available the next time you start a Python interpreter and
import tardis.
Run Ruff
TARDIS follows PEP 8 and uses Ruff for linting and formatting.
Note
Pre-commit hooks are no longer used in the TARDIS developer workflow. Run Ruff and tests directly from the active TARDIS development environment.
Install Ruff:
conda install -c conda-forge ruff
Lint code:
ruff check <source_file_or_directory>
Lint and fix automatically fixable issues:
ruff check <source_file_or_directory> --fix
For example, lint one parser module:
ruff check tardis/io/model/parse_density_configuration.py
Or lint and fix a package area:
ruff check tardis/io/model --fix
TARDIS adopts linting rules used by Astropy. Permanent rules are defined in
pyproject.toml. Non-permanent rules are defined in .ruff.toml. Add new
rules to .ruff.toml. To add a permanent rule, open a pull request against
pyproject.toml.
Use Ruff In VS Code
Use the official Ruff extension with the same environment you use for TARDIS:
Activate the TARDIS development environment in a terminal.
Install Ruff in that environment if it is not already installed:
conda install -c conda-forge ruff
In VS Code, install the Ruff extension by searching for
Ruffin the Extensions view. You can also install it from the command line:code --install-extension charliermarsh.ruff
Select the TARDIS Python interpreter with
Python: Select Interpreter. Choose the interpreter from the active TARDIS conda environment, not the base conda environment.Add or update
.vscode/settings.jsonin your TARDIS checkout:{ "ruff.enable": true, "ruff.lint.enable": true, "ruff.format.enable": true, "editor.formatOnSave": true, "[python]": { "editor.defaultFormatter": "charliermarsh.ruff" }, "editor.codeActionsOnSave": { "source.fixAll.ruff": "explicit", "source.organizeImports.ruff": "explicit" } }
With this setup, VS Code can show Ruff lint diagnostics in the editor, format Python files on save, and apply automatic Ruff fixes when requested.
Use Ruff In Anaconda-Based Editors
For Anaconda Navigator, Spyder, JupyterLab, or another editor launched from Anaconda, make sure the editor is using the TARDIS development environment:
Activate the TARDIS conda environment before launching the editor, or select that environment in the editor’s interpreter/kernel settings.
Confirm that Ruff is installed in that same environment:
ruff --versionIf the editor has no Ruff integration, run the CLI commands from the integrated terminal:
ruff check tardis ruff format tardis
Avoid configuring an IDE to use Ruff from base while running tests from the
TARDIS environment, because the editor diagnostics can then disagree with the
commands used for review.