Python scripts and Jupyter notebooks for analysing and visualising MUSE2 data files.
This is a Python application that uses uv for packaging and dependency management.
It provides pre-commit hooks for various linters
and formatters and automated tests using pytest and GitHub Actions.
Pre-commit hooks are automatically kept updated with a dedicated GitHub Action, this can
be removed and replaced with pre-commit.ci if using a public repo. The package version
is dynamically generated from the most recent git tag using
setuptools-scm.
It was developed by the Imperial College Research Software Engineering Team.
To get started:
-
Download and install uv following the instructions for your OS.
-
Activate a git repository (required for
pre-commitand the package versioning withsetuptools-scm):git init
-
Install the package and dependencies and set up the virtual environment:
uv sync
-
Activate the virtual environment, or just preface your commands with
uv runto use the virtual environment (see uv activate for more info):source .venv/bin/activate <command>
or
uv run <command>
-
Install the pre-commit git hooks:
uv run pre-commit install
-
Update the pre-commit hooks
uv run pre-commit autoupdate
-
Run the main app:
uv run python -m muse2_data_analysis
-
Run the tests:
uv run pytest
-
Create an initial commit (it's possible there might be some failures in pre-commit):
git add . git commit -m "Initial commit"
Use the commands uv add <package> and uv remove <package> to add or remove dependencies.
- Use the optional flag
--devto add/remove development dependencies. - Include the optional flag
--group <group-name>to add/remove dependencies from specific groups. - These will automatically update the
pyproject.tomlfile.
For further information, see the uv docs for managing dependencies.