Replies: 7 comments 8 replies
-
|
Here is an example workflow: flowchart LR
yaml --> readin
readin --> validate
validate --> Error{Is error?}
Error -->|Yes|endError((The file is wrong))
Error -->|No|Continue
You can learn more about it here: https://mermaid.ai/open-source/. |
Beta Was this translation helpful? Give feedback.
-
flowchart TD
subgraph Refactor[Refactoring]
direction LR
A[Hard-coded .py model Scripts] --> B[YAML files]
B --> C[YAML Loader]
C --> D[Dynamic UI/Scenarios]
D --> E[Equation Engine]
E --> F[Guardrails]
F --> G[App]
end
subgraph Architecture["Structure"]
direction TB
App[app.py: Main Entry] -->
Engine[engine.py: Parser & Eval Calculations] -->
Models -->
Utils[utils.py: Rounding & Formats]
subgraph Models["/models/"]
TB[tb_isolation.yaml]
Measles[measles.yaml]
end
end
|
Beta Was this translation helpful? Give feedback.
-
|
I appreciate you adding this, @EddW1219! But I think we need a bit more detail. For reference, discussions on GitHub should look a bit more like this (or at least, that is what I was expecting). Writing is a great skill to have, so it is not just coding. Would love to read your thoughts about how to implement this. Things that I am still missing a bit:
I think this workflow is a good start: flowchart TD
subgraph Architecture["Structure"]
direction TB
App[app.py: Main Entry] -->
Engine[engine.py: Parser & Eval Calculations] -->
Models -->
Utils[utils.py: Rounding & Formats]
subgraph Models["/models/"]
TB[tb_isolation.yaml]
Measles[measles.yaml]
end
end
We can chat more about this today. |
Beta Was this translation helpful? Give feedback.
-
|
Hi! Sorry that I've been absent, I didn't realize that this discussion was going on yet. Give me a while to catch myself up and then I'll hop in. |
Beta Was this translation helpful? Give feedback.
-
|
It may be beneficial to consider including some sort of visual interface for .yaml creation rather than expecting users to provide pre-made files. This would aid non-programmers in using the tool while still allowing for more granular programmatic control for advanced users. |
Beta Was this translation helpful? Give feedback.
-
|
I asked copilot, and this is what it created for me: https://github.com/EpiForeSITE/epiworldPythonStreamlit/blob/5aee265b4970871a787887b9c939c7727d8494aa/docs/design-proposal.md |
Beta Was this translation helpful? Give feedback.
-
|
@gvegayon This seems valuable. A couple thoughts:
With the current problem description (i.e. authorship by those with some technical skill and STLT consumers), I wonder if writing things in Javascript wouldn't be a better approach; then we wouldn't be trying to encode arbitrary logic into formula strings. The YAML layer could then exist as a layer on top that simply calls into the JS API. The browser can already load this arbitrarily, so this wouldn't present a large technical challenge I don't believe. The main benefit there is that we’d stop trying to reinvent a constrained expression language inside a serialization format. If the logic is genuinely logic, we should probably let it live in an actual programming language instead of smuggling it through strings and then writing an interpreter for it. Right now, once we allow "arbitrary equations," we’re implicitly committing to defining the grammar of those equations, validating them, evaluating them safely, deciding how types propagate, handling edge cases and errors, and so on and so forth. My thinking is, that that's already the shape of a language runtime. At that point YAML is just acting as a transport for code, which feels like the wrong abstraction boundary. If the primary authors are technically capable, at least initially, I don’t think optimizing for "no-code" authoring should dominate the design. A small JS module that exports well-defined functions is straightforward to write, test, and version. Consumers can import it directly in the browser (i.e. from the local file system, or even from a remote resource URL). We'd get native tooling, stack traces, and type checking if we want it. For non-technical authors, YAML can sit pretty easily on top. Using the same aforementioned JS API, we could A) deserialize the YAML, B) loop over the data and call the respective JS functions to set up internal state. In other words, instead of stretching YAML toward a programming language, I propose we let it stay a data language and put behavior where behavior naturally belongs. That separation feels cleaner and easier to maintain over time to me, although I'm not the non-technical audience this might eventually get targeted toward. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The cost calculator app will provide a straightforward way for non-expert users to investigate the potential cost of an outbreak or disease burden from an economic perspective. The project already has a version up and running, and now that we have received some feedback from public health partners, we need to enter the next development stage. This document highlights the project's requirements and provides technical details on the implementation.
User stories
User stories are brief descriptions of what users would like to do with the software. Originating in the agile world, these provide simple bits of information that developers can use to inform the design of the software. As a minimum, each story should have a role, the action, and the expected benefit out of it. The baseline is: "As a [persona], I want [action] so that [benefit]". Here are some user stories
As an epidemiologist, I would like to be able to select a disease so that all relevant costs are already available.
As an epi, I would like to specify how many breaks are included in the model, so that it provides multiple points of comparison.
Like any user, I would like the app to allow me to save the current state of the model, so that I could share it and reuse it whenever I need.
As a developer, I would like this to be modular, allowing me to extend it easily to other diseases.
As a public health official, I would like this to allow me to generate a report with a summary, so I can share this directly with the lawmakers/general public/epis.
Like any user, I would like to be able to read the assumptions behind the model (possibly a longer description), so that I can justify the numbers.
As an epi, I would like the app to include some guardrails to avoid generating misleading information. In the worst-case scenario, this should feature a warning.
Technical specs
Here are some technical specs that the app should have:
In an ideal world, the models should be built using a simple yaml file that contains parameters, ways to compute the data, references, and text information.
Since most of the models will generate the same type of outcome, we should standardize the reports, simplifying the process of extending the program. For instance, we can have yaml entries that specify: title, description, authors, and introduction as free text.
The yaml should include a separate entry for the parameters with the following fields per parameter: name (text), description (for a tool tip), default value (numeric), min value (numeric), max value (numeric), references (free text), unit label (e.g, usd, people, hours, days, etc.), and if it is integer or double (essentially, show decimals or not).
The yaml should also include an entry for named equations, which will provide the data that will go in the table. These should be in the form of: name/label (text), equation (Python code, essentially), unit label (e.g., usd, people, hours, etc.), output type (integer or double). Here is an example:
Finally, the yaml with the table description in the following way: column label (Python code, possibly taking values from the output/input), and then a list with individual entries for each output, including: label (for the table) and value (pointing to which value from the equation).
Using the data from the description of parameters, we can automatically add a table that describes them, including to links, if available, to references. The benefit of especifying the contents for a single column is that we can allow the user to then specify what values they want to use, so if they want to use 1, 2, or 10 columns, it is up to them.
Expected outcome from the discussion
Beta Was this translation helpful? Give feedback.
All reactions