This repository holds the code to generate reports based on Riverscapes Consortium data, largely maintained in AWS Athena.
It consists of a python project for each report generator, as well as scripts necessary to run the project with Fargate.
Code to maintain the web UI that allows users to trigger report generation with custom parameters is in another repository, rs-reports-monorepo.
Use uv sync. If you're going to make any changes, there are additional libraries used for development. Run uv sync --extra dev instead.
You may need to install WeasyPrint following these instructions.
If you run the "📋 Report Launcher" task from the launch.json file you will be prompted for which report to run and a series of choices to choose the parameters for that report. You can bypass these choices by setting optional environment variables in your .env file.
# MANDATORY. You need to set these if you want the reports to run
DATA_ROOT=/where/i/store/my/data/rs_reports
SPATIALITE_PATH=/opt/homebrew/lib/mod_spatialite.8.dylib
# OPTIONAL OVERRIES FOR "Rivers Need Space" REPORT
# RNS_AOI_GEOJSON=/my/awesome/aoi.geojson
# RNS_REPORT_NAME='Steve the report'
# RNS_CSV=
# OPTIONAL OVERRIES FOR "IGO Project" REPORT
IGO_AOI_GEOJSON=/my/awesome/aoi.geojson
IGO_REPORT_NAME='Gary'
To keep notebook outputs (plots, binary, HTML, etc.) out of git commits, we use nbstripout via pre-commit hooks.
- Install all dev dependencies:
- Install the pre-commit hook:
uv sync --extra dev
uv run pre-commit installThis ensures that any .ipynb files you commit will have their output cells automatically stripped.
- Just commit as usual. The hook will run automatically.
- If it changed your file you'll see this as an additional change to add to your commit
- If you want to commit the output, it is possible to set the
keep_outputtag on a cell or the notebook. See nbstripout readme. - if you want the output for yourself, you might keep a copy in a folder named
localonlywhich has been added to .gitignore - To manually check use or run all hooks on all files:
uv run pre-commit run --all-files