Draft
Conversation
Fix `TypeError` caused by providing the subpopulation populations, `list[int]`, to `check_parameter_positivity` by providing the subpopulation names, `list[str]`. This would cause an error when trying to construct an error message when it tried to join the subpopulation names together. The exception was: `sequence item 0: expected str instance, numpy.int64 found`.
Fixed typo in the name of the distribution creation helper in two places in `inference_parameter.py`. Also corrected call to use `DistributionABC.sample` method because a specific size was required.
Added a `support` property to the `DistributionABC` class which returns a tuple of two numbers representing the upper and lower bounds respectively. This property pulls said bounds from either the `_lower/upper_bound` attributes if defined by the implementation or `_lower/upper` properties if overridden by the implementation. Added to the current examples to demonstrate usage. Minor modifications to the commond distributions test was required.
Incorporated bounds provided by `DistributionABC.support` into the `InferenceParameters` class for lower/upper bounds used in proposal rejection. Also converted lower/upper bounds representation from list of floats to numpy arrays of floats for performance reasons.
Used the 'simple_usa_statelevel' example to demonstrate how inference on modifiers now supports more than 'truncnorm' distributions. Changed the 'truncnorm' usage in the seir modifiers section to use a 'gamma' distribution with the same mean and variance.
72b254b to
8d7b3aa
Compare
6 tasks
Added unit tests and changed the API of `gempyor.NPI.helpers.get_spatial_groups`. The API change moves away from requiring a confuse configview to use the function, which pushes the confuse wrangling to the caller. Improves unit testing and general purpose usage and makes the function more stable as we move away from confuse. Also simplified/improved the logic and enhanced the documentation and type hints.
For ease of constructing and manipulating modifier spatial groups converted the `SpatialGroups` typed dict to a frozen data class. This allows for the continued typing support as well as adding support for iterating over a `SpatialGroups` class in a consistent way. Also migrated `get_spatial_groups` into the `SpatialGroups.from_subpopulations` class method. Added corresponding documentation and unit tests.
* Address suggestions from `pylint` to make the code more readable as
well as add documentation/type hints.
* Added initial, highly targeted unit tests. Including for the
`inject_proposal` method.
* Consolidated `hit_*` methods into the `check_in_bound` method.
* Made the `{l/u}bs` attributes private and extract them from the
distribution object on behalf of the user in `add_single_parameter`.
* Added steps, including script, to run simulation and create a ground truth file from it. * Added a `Makefile` to quickly run everything in the folder. * Added the EMCEE and R inference configuration files.
* Add `--from-chains` option to `flepimop simulate` to read a `Chains` object from a pickle file. * Rename `nchains` to `nslots` in `gempyor.simulate`.
8d7b3aa to
2236d83
Compare
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.
Describe your changes.
This pull request adds
gempyor.outputfor interacting with model outputs programmatically.Blocked by #601.
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 GH-...