This repository is for the course CVEN 5393: Water Resources Systems and Management, taught by Prof. Joseph Kasprzyk at the University of Colorado Boulder. The examples were started in Spring 2023 and have been continually updated.
Currently the folder structure is:
- AnalyticHierarchyProcess: Source code and example AHP setup files for a Streamlit app that enables in-browser AHP calculations.
- Colab Notebooks: Python notebooks intended to be opened in Google Colab. Each notebook is self-contained and illustrates a principle in water resources and systems analysis. These can also be used on your own Jupyter notebook server.
- Data: A few example datafiles that are used for loading into notebooks and elsewhere.
- RiverWare Example Models: Example models implemented in RiverWare, a river basin and reservoir model developed by the Center for Advanced Decision Support for Water and Environmental Systems at the University of Colorado Boulder.
- Training: Lecture notes and explainers (git/GitHub, Python virtual environments, CDN and data distribution).
- exam_prep: Question bank JSON files (promptukit format) consumed by downstream trivia tooling via jsDelivr.
- cvtools: A small editable Python package of shared utilities for this workspace (installed via Poetry).
- scripts: Maintenance scripts, including
tag-release.shfor cutting versioned releases. - archived: Legacy
requirements.txtandsetup.cfg, kept for reference now that Poetry manages dependencies.
For more information, consult the webpage of the Kasprzyk Research Group.
This repo serves dual roles: course materials and a versioned data source consumed by external tools (e.g. hardball-trivia) via jsDelivr. jsDelivr resolves file URLs directly from GitHub tags, so tags are the version — independent of any package registry.
Rules that follow from this:
- Every release must be tagged (e.g.
v0.1.0). Usescripts/tag-release.sh, which reads the version frompyproject.tomland creates a matching tag, keeping the two in sync. - Do not force-push or delete tags. Downstream consumers pin specific tag versions; rewriting a tag silently breaks them.
- Bump
pyproject.tomlversion and cut a new tag whenever files consumed via jsDelivr change.
To release a new version:
# 1. Commit and push your changes first
git add <files>
git commit -m "your message"
git push
# 2. Then tag the release (reads version from pyproject.toml, creates and pushes the tag)
./scripts/tag-release.shThis repository can be managed with Poetry. Poetry's configuration is in pyproject.toml.
Installation and basic commands (see Poetry docs for platform-specific install):
# Install Poetry (see https://python-poetry.org/docs/#installation)
poetry install # install dependencies and create virtual environment
poetry shell # spawn a shell within the virtual environment
poetry run python -m pip install --upgrade pip
poetry lock # (optional) refresh/produce `poetry.lock`
poetry build # build distribution packagesThe legacy requirements.txt and setup.cfg have been moved to archived/ for reference; Poetry (pyproject.toml + poetry.lock) is now the source of truth for dependencies. Current dependencies include promptukit and parasolpy alongside the standard scientific Python stack.
Short guidance for updating and consuming promptukit in this project.
- Publish (maintainer): bump the version in the
promptukitrepo (for examplepoetry version patchorpoetry version 0.1.550), then build and publish:
python -m build
python -m twine upload dist/*
# or: poetry publish --build --repository <name>Ensure the package's distributed metadata (for example promptukit.__version__) matches the release tag.
- Consumer (this repo): keep a reasonable constraint in
pyproject.tomland commitpoetry.lockfor reproducible installs. Update and install the new release with:
poetry update promptukit # update lock and install newest matching release
# or to pin an exact release:
poetry add promptukit==0.1.550 # updates pyproject, lock, and installs- Testing unreleased changes: if the new version isn't published yet, use a VCS or local path dependency for testing:
promptukit = { git = "https://github.com/jrkasprzyk/promptukit.git", rev = "v0.1.550" }or:
poetry add git+https://github.com/jrkasprzyk/promptukit.git@v0.1.550-
Troubleshooting: if
poetry lock/poetry updatecomplains "no versions of promptukit match ...":- Confirm the release exists on PyPI:
python -m pip index versions promptukit - Clear Poetry's PyPI cache and retry:
poetry cache clear pypi --all - Check for an alternate repository in Poetry config:
poetry config --list
- Confirm the release exists on PyPI:
-
Verify installed version:
poetry show promptukit
poetry run python -c "import importlib.metadata as m; print(m.version('promptukit'))"- Practical rules: commit
poetry.lockfor reproducible installs; preferpoetry add/poetry updateover manual edits topyproject.toml; use VCS/path deps while developing versions that are not yet published.