Skip to content

makefile(streamlit the same, stlite added, bug for display fixed, out…#21

Merged
gvegayon merged 3 commits intomainfrom
edward_branch
Apr 2, 2026
Merged

makefile(streamlit the same, stlite added, bug for display fixed, out…#21
gvegayon merged 3 commits intomainfrom
edward_branch

Conversation

@EddW1219
Copy link
Copy Markdown
Collaborator

@EddW1219 EddW1219 commented Mar 25, 2026

  • Fix running_in_stlite(): remove duplicate, use Pyodide-recommended detection (sys.platform == "emscripten")
  • Escape HTML labels in utils/parameter_ui.py with html.escape() to prevent injection
  • Fix Makefile: UV ?= uv, fix smelected typo, restructure $(BUILD_DIR) mkdir into INDEX_HTML rule
  • Remove -> None from main() in scripts/build_index.py
  • Fix AGENTS.md function contract for render_parameters_with_indent
  • Fix Excel reset callback model_id mismatch in app.py

Copilot AI review requested due to automatic review settings March 25, 2026 07:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds stlite build scaffolding and contributor guidance while adjusting parameter loading/rendering to better support stlite (including handling nested YAML parameters: blocks and attempting to prevent blank widget values from overwriting defaults).

Changes:

  • Add stlite build generation via scripts/build_index.py and a new Makefile workflow.
  • Normalize YAML parameter defaults and add helpers for leaf-parameter defaults/coercion (stlite-specific).
  • Add AGENTS.md contributor/agent conventions and refactor parameter UI rendering/reset behavior.

Reviewed changes

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

Show a summary per file
File Description
utils/parameter_ui.py Refactors parameter reset/render logic and changes widget keying + sidebar rendering.
utils/parameter_loader.py Adds typing, supports nested parameters: YAML layouts, and introduces get_leaf_defaults.
scripts/build_index.py New helper to generate build/index.html for stlite and mount project files.
app.py Adds stlite detection + parameter normalization/coercion; updates parameter source handling and UI flows.
Makefile New targets for dev/stlite build/serve and quality checks.
AGENTS.md New contributor/agent conventions and documented function contracts.

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

@gvegayon gvegayon requested a review from olivia-banks March 25, 2026 16:07
@gvegayon
Copy link
Copy Markdown
Member

Thank you, @EddW1219! @olivia-banks, can you take a look at this PR?

Copy link
Copy Markdown
Member

@olivia-banks olivia-banks left a comment

Choose a reason for hiding this comment

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

👍!

@olivia-banks
Copy link
Copy Markdown
Member

Linking to #13.

@olivia-banks
Copy link
Copy Markdown
Member

@EddW1219 Do you have an ETA on this?

@gvegayon
Copy link
Copy Markdown
Member

@copilot, please address the comments in #21 (review) and #21 (review)

attn @olivia-banks @EddW1219

@olivia-banks
Copy link
Copy Markdown
Member

olivia-banks commented Apr 1, 2026

@gvegayon I think this is okay to be merged as is. A fair number of these are rendered obsolete by #17. The failing action is already fixed in main as well.

- Add pandas-stubs, types-openpyxl, types-PyYAML to dev dependencies
- All checks now pass: ruff, mypy, pytest
- 91% coverage on utils/parameter_ui.py (changed code)
- Addresses olivia-banks' review comments
@EddW1219 EddW1219 force-pushed the edward_branch branch 2 times, most recently from 8b8e87f to 50b18e2 Compare April 1, 2026 02:38
@EddW1219
Copy link
Copy Markdown
Collaborator Author

EddW1219 commented Apr 1, 2026

@gvegayon @olivia-banks Hi George and Olivia, I just merged the changes to current PR.

@olivia-banks
Copy link
Copy Markdown
Member

olivia-banks commented Apr 1, 2026

This looks great to me, and I think it's ready to merge after we get #17 in here.

@gvegayon
Copy link
Copy Markdown
Member

gvegayon commented Apr 1, 2026

This looks great to me, and I think it's ready to merge after we get #17 in here.

#17 has conflicts

@olivia-banks
Copy link
Copy Markdown
Member

This looks great to me, and I think it's ready to merge after we get #17 in here.

#17 has conflicts

These look to be new after Edward's force-push. I'll go ahead and resolve.

@olivia-banks
Copy link
Copy Markdown
Member

Resolved, waiting on merge.

* [stash] draft

* [stash] draft

* [test] test!

* [format] templating

* [dep] dep

* Update src/epicc/model/__init__.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/epicc/config/__init__.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* [xlsx] support nested dict writes via dot-notation flattening

* [yaml] use `ruamel` round-trip template to preserve trivia

* Update src/epicc/formats/yaml.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* [import] remove unused

* [run] add shim

* fix: address PR review comments from olivia-banks

- Use Pyodide-recommended stlite detection (sys.platform/sys.modules)
- Remove duplicate running_in_stlite() definition (F811)
- Escape HTML labels with html.escape() in parameter_ui.py
- Fix Makefile: UV ?= for env override, smelected typo, inline mkdir
- Remove -> None from build_index.py main()
- Fix AGENTS.md function contract for render_parameters_with_indent
- Fix Excel reset callback to use consistent model_key

Agent-Logs-Url: https://github.com/EpiForeSITE/epiworldPythonStreamlit/sessions/60bec289-6a09-4711-a403-13e7f0eb4742

Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>

* [make] bring `Makefile` inline with new build script

* [type] fix hinting

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
Copy link
Copy Markdown
Member

@gvegayon gvegayon left a comment

Choose a reason for hiding this comment

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

OK, I will let you fix any issues after merging, @olivia-banks and @EddW1219. Thanks!

@gvegayon gvegayon merged commit 8607263 into main Apr 2, 2026
1 check failed
@gvegayon gvegayon deleted the edward_branch branch April 2, 2026 00:22
@gvegayon gvegayon linked an issue Apr 2, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup stlite framework - via Makefile or similar, i.e., single command

5 participants