Conversation
Introduce Pydantic Models for Builtin Models
There was a problem hiding this comment.
Pull request overview
This PR refactors parameter handling for Python-based models to use Pydantic schemas for validation, improves parameter-file reload behavior in the Streamlit UI, and updates the built-in models to consume typed parameter objects.
Changes:
- Introduces model-specific Pydantic parameter schemas and validates uploaded parameter files against them.
- Updates the Streamlit app flow to (a) refresh parameters when uploaded content changes and (b) block execution on validation errors with user-facing details.
- Adjusts supporting utilities (parameter loader/UI helpers) to support typed validation + nested parameter structures.
Reviewed changes
Copilot reviewed 8 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/epicc/utils/parameter_ui.py | Exposes item_level() for shared indent parsing and updates callers accordingly. |
| src/epicc/utils/parameter_loader.py | Loads parameter files via format readers and validates them using model.parameter_model(). |
| src/epicc/models/tb_isolation.py | Adds Pydantic schemas for parameters and updates run() to use typed access. |
| src/epicc/models/measles_outbreak.py | Adds a Pydantic schema for parameters and updates run() to use typed access. |
| src/epicc/model/base.py | Changes the base model contract to accept BaseModel params and requires parameter_model(). |
| src/epicc/formats/yaml.py | Minor module export (__all__) placement adjustment. |
| src/epicc/main.py | Adds parameter validation UX, typed param construction, and more robust upload identity tracking. |
| pyproject.toml | Formatting-only change. |
| app.py | Removes the top-level docstring from the shim entrypoint. |
| .gitignore | Reorders/expands ignored artifacts (coverage, build outputs, caches). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* [stash] draft * [stash] draft * [test] test! * [format] templating * [dep] dep * [report] add report generation button
|
Sorry for the delay here, turns out it was an issue both with my browser and my installation. Updating my browser and reinstalling both system Python and |
|
Will work on resolving these issues and re-request after the most recent merge. |
* [model] make `BaseSimulationModel` generic over `ParamsT` * [tb-iso] remove unused `hourly_wage_public_health_worker` parameter * [app] cache uploaded parameter file sha1 in session
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* [model] make `BaseSimulationModel` generic over `ParamsT` * [tb-iso] remove unused `hourly_wage_public_health_worker` parameter * [app] cache uploaded parameter file sha1 in session * [style] hide `.export-hint` in print media * [branding] persist title
* [model] make `BaseSimulationModel` generic over `ParamsT` * [tb-iso] remove unused `hourly_wage_public_health_worker` parameter * [app] cache uploaded parameter file sha1 in session * [style] hide `.export-hint` in print media * [branding] persist title * [branding] move to `epicc` * [gha] overhaul the container image situation
Agent-Logs-Url: https://github.com/EpiForeSITE/epiworldPythonStreamlit/sessions/c0476fd8-31f6-4c9a-bf7c-a585696fa679 Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
Fixed in c468340. The |

Implement report generation. Improve readacitivty of streamlit GUI. Implement more Pydantic models, hooking into the rest of the system, and introduce new typing hints.