Skip to content

Add Model Editor / Creator Workflow#53

Open
olivia-banks wants to merge 5 commits into
EpiForeSITE:mainfrom
olivia-banks:ob-fix-41
Open

Add Model Editor / Creator Workflow#53
olivia-banks wants to merge 5 commits into
EpiForeSITE:mainfrom
olivia-banks:ob-fix-41

Conversation

@olivia-banks

Copy link
Copy Markdown
Member

Fix #41.

@olivia-banks
olivia-banks requested a review from Copilot July 10, 2026 05:36
@olivia-banks olivia-banks self-assigned this Jul 10, 2026
@olivia-banks olivia-banks added the enhancement New feature or request label Jul 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an in-app model editor workflow to EPICC so users can create/edit YAML model documents via a Streamlit GUI, with schema validation feedback and YAML export, and adds “dirty” indicators to parameter widgets/groups in the calculator UI.

Changes:

  • Introduces a new Streamlit-based model editor (src/epicc/ui/editor.py) for editing model metadata, parameters, equations, scenarios, report blocks, and presets with validation + YAML export.
  • Integrates an “Open Model Editor” toggle into the main app flow (src/epicc/__main__.py) to switch between calculator mode and editor mode for the selected model.
  • Enhances parameter rendering to mark modified (“dirty”) parameters/groups with a [*] suffix (src/epicc/ui/parameters.py).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/epicc/ui/parameters.py Adds dirty-ID computation and label suffixing to visually indicate modified parameters/groups; minor refactor in group rendering.
src/epicc/ui/editor.py New GUI editor for authoring/validating/exporting model YAML documents.
src/epicc/__main__.py Adds editor-mode toggle and routes into the editor for the currently selected model.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/epicc/ui/parameters.py Outdated
Comment thread src/epicc/ui/parameters.py Outdated
Comment thread src/epicc/ui/editor.py
Comment thread src/epicc/__main__.py
Comment thread src/epicc/__main__.py Outdated
@olivia-banks

Copy link
Copy Markdown
Member Author

If one of you could try running this feature branch and seeing if there's anything I'm missing, that would be appreciated. Copilot doesn't seem great at catching stuff like that and I've resolved its comments.

@gvegayon

Copy link
Copy Markdown
Member

If one of you could try running this feature branch and seeing if there's anything I'm missing, that would be appreciated. Copilot doesn't seem great at catching stuff like that and I've resolved its comments.

I could do it! But it would be great if you could move this branch from your repo to EpiForeSITE instead. LMK when you do that.

@olivia-banks

Copy link
Copy Markdown
Member Author

If one of you could try running this feature branch and seeing if there's anything I'm missing, that would be appreciated. Copilot doesn't seem great at catching stuff like that and I've resolved its comments.

I could do it! But it would be great if you could move this branch from your repo to EpiForeSITE instead. LMK when you do that.

Pushed upstream. This PR doesn't track that branch but you should now be able to check it out locally. Sorry for the oversight.

@gvegayon

Copy link
Copy Markdown
Member

Hey @olivia-banks, I just tried it out and I got an error:

image

Here is the full text:

Data validation failed: 1 validation error for Model Value error, Scenario 'scenario_x' var 'n_cases' must be an integer, got '' [type=value_error, input_value={'title': 'Measles Outbre...ontract_tracer': 6.0}}]}, input_type=dict] For further information visit https://errors.pydantic.dev/2.12/v/value_error

Also, notice that I had to merge the main branch into your branch to make it work (I was having the same issues regarding missing modules).

@olivia-banks

Copy link
Copy Markdown
Member Author

@gvegayon Should be fixed now, and I also changed some stuff for quality of life (entering the editor without an active model, some help text, et cetera). The error you were running into was because I used a None instead of a [] in the _BLANK template which was fighting with the schema.

Also, sorry that you had to merge it in yourself, I had merged in origin/main instead of upstream/main so I think it was confused by the hashes. Should be resolved.

olivia@exbop epiworldPythonStreamlit % git merge upstream/main
Merge made by the 'ort' strategy.
 pyproject.toml                   |  4 ++--
 src/epicc/ui/model_loader.py     | 20 +++++++++++++-------
 tests/epicc/test_model_loader.py | 21 +++++++++++++++++++++
 3 files changed, 36 insertions(+), 9 deletions(-)
 create mode 100644 tests/epicc/test_model_loader.py
olivia@exbop epiworldPythonStreamlit % git push upstream HEAD:ob-fix-41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a separate app for building model files

3 participants