Conversation
a9b7026 to
7bb6035
Compare
pearsonca
left a comment
There was a problem hiding this comment.
Just some thoughts on the work in progress
There was a problem hiding this comment.
This seems like a good start for a roll-our-own approach to distributions.
But: how much of an overhaul elsewhere would it be to just use https://www.pymc.io/projects/docs/en/stable/api/distributions.html (for example, there are other libraries that also manage this kind of thing)
There was a problem hiding this comment.
It already seems like mostly what's happening is wrapping rng.SOMENAME - there is a way to have that as the default in the parent class (basically, use distribution field to know what function to call, have kwargs built from internal fields) and then override for the cases that really need to be custom (e.g. truncnorm)?
3272cb3 to
7bb6035
Compare
|
I could not really read the diff which is huge, and I don't follow much flepi but my 2-cent is that I would ditch the recursive autocall modifier thing, which makes anything like smart inference hard. I would load them all at once from config. config breaking change I think are necessary:
|
These tests are duplicates, which gets addressed in #570 , but for now we need to add both to the slow group to allow workflow success.
7bb6035 to
9dc7923
Compare
There was a doubly-named test in `test_npis.py` that also contained an outdated loc .
Implement this method in `_single_period::SinglePeriodModifier` class.
`.apply_dataframe()` is a wrapper around `.apply()`
Additionally, rename `SinglePeriodModifier` to `PeriodicModifier` (now represents both single and mulitperiod)
Implement this method in `_single_period::SinglePeriodModifier` class.
`.apply_dataframe()` is a wrapper around `.apply()`
Additionally, rename `SinglePeriodModifier` to `PeriodicModifier` (now represents both single and mulitperiod)
8f7e50f to
702d108
Compare
Describe your changes.
gempyor.NPIfunctionality, to build a baseline of existing behavior as needed.applyabstract method toModifierABCtaking argumentsparameter_name,parameter,methodand usingSinglePeriodModifieras an example implementreduce. nb: see helpers.py for ex. Should drop into:flepiMoP/flepimop/gempyor_pkg/src/gempyor/parameters.py
Lines 309 to 336 in 00a262d
apply_dataframemethod toModifierABCthat is a wrapper aroundapply.ModifiersCollectionusingpydantic.BaseModelto represent the 'outcome_modifiers' and 'seir_modifiers' sections in config files. Pretty minimal,scenarios: list[str]andmodifiers: list[Modifier].ModifiersCollectionto have ascenarios_mapattribute (needs better name or maybe some rethinking, ideally would be calledscenariosbut that attribute is already occupied) that isdict[str, list[str]]to represent "stacked modifiers". Requires adding a model validator toModifiersCollectionto rewriteStackedModifiers to this to maintain backwards compatibility.reduce(now .apply()) method toModifiersCollectionthat implements similar logic to the currentStackedModifierthat takes ascenarioand modifies multiple parameters at once.MultiPeriodModifier. (ie, incorporate MultiPeriodModifier into PeriodicModifier)selectedoption forsubpop_setupfails if modifiers apply to only a single subpop #490 if not already addressed by stricter validation (might require following up for details/cmds).ModifiersCollectionintogempyor.seir/outcomes.git rmthe NPI subpackage.Does this pull request make any user interface changes? If so please describe.
The user interface changes are...
Those are reflected in updates to the documentation in ...
What does your pull request address? Tag relevant issues.
This pull request addresses: #409.