Skip to content

Python scripts and Jupyter notebooks for analysing and visualising MUSE2 data files

License

Notifications You must be signed in to change notification settings

EnergySystemsModellingLab/muse2_data_analysis

Repository files navigation

MUSE2 data analysis

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.

Usage

To get started:

  1. Download and install uv following the instructions for your OS.

  2. Activate a git repository (required for pre-commit and the package versioning with setuptools-scm):

    git init
  3. Install the package and dependencies and set up the virtual environment:

    uv sync
  4. Activate the virtual environment, or just preface your commands with uv run to use the virtual environment (see uv activate for more info):

    source .venv/bin/activate
    <command>

    or

    uv run <command>
  5. Install the pre-commit git hooks:

    uv run pre-commit install
  6. Update the pre-commit hooks

    uv run pre-commit autoupdate
  7. Run the main app:

    uv run python -m muse2_data_analysis
  8. Run the tests:

    uv run pytest
  9. Create an initial commit (it's possible there might be some failures in pre-commit):

    git add .
    git commit -m "Initial commit"

Updating Dependencies

Use the commands uv add <package> and uv remove <package> to add or remove dependencies.

  • Use the optional flag --dev to add/remove development dependencies.
  • Include the optional flag --group <group-name> to add/remove dependencies from specific groups.
  • These will automatically update the pyproject.toml file.

For further information, see the uv docs for managing dependencies.

About

Python scripts and Jupyter notebooks for analysing and visualising MUSE2 data files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages