Open
Conversation
Member
Author
|
This has a ton of extra changes because it's based off of #17; the requisite changes are located in: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a Streamlit “Export Results as PDF” button (via browser print) and introduces print-specific CSS so results can be saved cleanly as a PDF. It also restructures the app into a src/epicc package with new config/model/formats abstractions, plus adds tests for the new formats/model-loading utilities.
Changes:
- Add export/print flow backed by session state plus
@media printCSS rules to hide Streamlit chrome. - Refactor the app into
src/epiccwith new config loading, model base classes, parameter loaders/UI helpers, and built-in model implementations. - Add a new
epicc.formatslayer (YAML/XLSX + template generation) and corresponding pytest coverage.
Reviewed changes
Copilot reviewed 38 out of 45 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/section_renderer.py | Removed legacy top-level Streamlit section renderer (migrated into package). |
| utils/parameter_ui.py | Removed legacy sidebar parameter UI helpers (migrated into package). |
| utils/parameter_loader.py | Removed legacy param loader (replaced by new formats + loader in package). |
| utils/model_loader.py | Removed legacy dynamic model discovery/loader (replaced by built-in registry). |
| styles/sidebar.css | Removed old CSS file (moved into package web assets). |
| tests/epicc/test_model_loader.py | Adds tests for epicc.model.load_model. |
| tests/epicc/test_formats.py | Adds tests for format selection + typed reads. |
| tests/epicc/test_formats_yaml.py | Adds unit tests for YAMLFormat read/write. |
| tests/epicc/test_formats_xlsx.py | Adds unit tests for XLSXFormat read/write. |
| tests/epicc/test_formats_template.py | Adds integration tests for template generation to YAML/XLSX. |
| src/epicc/web/sidebar.css | Adds sidebar styling plus print CSS to hide UI chrome and improve PDF output. |
| src/epicc/utils/section_renderer.py | Reintroduces section rendering in the epicc package with block-type dispatch. |
| src/epicc/utils/parameter_ui.py | Reintroduces parameter sidebar renderer/reset logic in the epicc package. |
| src/epicc/utils/parameter_loader.py | New param loader using epicc.formats and a flattening adapter for sidebar UI. |
| src/epicc/utils/model_loader.py | Defines built-in model registry returning TB + measles model instances. |
| src/epicc/utils/export.py | Implements session-state driven “Export Results as PDF” button and print trigger injection. |
| src/epicc/utils/excel_model_runner.py | Refactors imports/formatting; reuses shared flatten_dict. |
| src/epicc/models/tb_isolation.yaml | Adds default parameter YAML for the TB Isolation model. |
| src/epicc/models/tb_isolation.py | Adds packaged TB Isolation Python model implementing BaseSimulationModel. |
| src/epicc/models/measles_outbreak.yaml | Adds default parameter YAML for the Measles Outbreak model. |
| src/epicc/models/measles_outbreak.py | Adds packaged Measles Outbreak Python model implementing BaseSimulationModel. |
| src/epicc/model/schema.py | Introduces Pydantic schema for declarative YAML-based models. |
| src/epicc/model/base.py | Introduces BaseSimulationModel ABC for Python-defined models. |
| src/epicc/model/init.py | Adds load_model() wrapper for reading/validating YAML model configs. |
| src/epicc/formats/yaml.py | Adds YAML format reader/writer implementation. |
| src/epicc/formats/xlsx.py | Adds XLSX format reader/writer implementation including dot-notation nesting. |
| src/epicc/formats/template.py | Adds template generation from Pydantic models (placeholders + defaults). |
| src/epicc/formats/base.py | Adds BaseFormat abstraction for parameter/model file IO. |
| src/epicc/formats/init.py | Adds format registry + read_from_format() validation wrapper. |
| src/epicc/config/schema.py | Adds typed config schema. |
| src/epicc/config/default.yaml | Adds default app configuration YAML. |
| src/epicc/config/init.py | Adds config loader and global CONFIG singleton. |
| src/epicc/main.py | Replaces app.py with packaged Streamlit entrypoint and export integration. |
| sample/TB Isolation.xlsx | Adds sample Excel workbook (binary) for TB isolation. |
| sample/Measles Outbreak.xlsx | Adds sample Excel workbook (binary) for measles outbreak. |
| sample/~$TB Isolation.xlsx | Adds an Excel temporary lock file (binary/PII). |
| pyproject.toml | Updates dependencies (pydantic/ruamel/pytest) and pytest configuration. |
| models/tb_isolation.py | Removes legacy standalone TB isolation model module. |
| models/measles_outbreak.py | Removes legacy standalone measles model module. |
| config/paths.yaml | Removes legacy config file. |
| config/global_defaults.yaml | Removes legacy config file. |
| config/app.yaml | Removes legacy config file. |
| app.py | Removes legacy top-level Streamlit app entrypoint (replaced by src/epicc/__main__.py). |
| .gitignore | Expands ignore patterns (venv, build artifacts, editor files, etc.). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
Blocked by #17. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a report generation button that uses the browser's native functionality to produce a PDF, triggered by a button.