Some code. Nice.
- Let's add uv. We wont do this as a workspace, and we'll use the flat structure.
uv init --app- Add our project dependencies:
uv add numpy scipy pandas matplotlib - Add dev dependencies:
uv add --dev ruff pre-commit - Set up some ruff defaults in the pyproject.toml, just the line length and target python should do for now.
- Let's add a precommit. Copy one from the internet is easiest. I'll put one below.
- Maybe a makefile so people don't have to remember what to run.
- At this point I've only got the plot_powerspectrum_fors... okay lets rename this and see if we can clean the code. Don't forget the VSCode ruff extension.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: ["--maxkb=5000"]
- id: check-toml
- id: check-json
- id: check-symlinks
- id: debug-statements
- id: detect-private-key
- id: check-yaml
args:
- --unsafe
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.0
hooks:
- id: ruff
args: ["--fix", "--no-unsafe-fixes"]
- id: ruff-format