Conversation
Includes ForecastSimulator, ParticleFilterSimulator, and EnsembleKalmanFilterSimulator as top-level interfaces.
* Edited comments and date range * fix_missing added to ADRIO * Edits to ADRIO messaging and type usage based on Tyler's comments * Changed valid date range to start at 1-1-2020. * Ruff linting
* Implement RandomLocationsAndRandomSeed class Added RandomLocationsAndRandomSeed class for random infection seeding. * Fixed formatting.
Co-authored-by: Tyler Coles <tyler.coles@nau.edu>
Refactor and reorganization of the filtering-to-forecasting workflow. Class names are now more explicit and the API is more consistent across classes. Also includes plotting functionality for the output of pipeline simulations. * Implementation of the filtering and forecasting pipeline subsystem. Includes ForecastSimulator, ParticleFilterSimulator, and EnsembleKalmanFilterSimulator as top-level interfaces. * Updated type annotations. Added ABC to abstract classes. * Added override decorator as appropriate. Updated operations on dictionaries of unknown parameters to have consistent usage of keys when iterating over them. * Added validation upon construction for only using a `Gaussian` likelihood with an `EnsembleKalmanFilterSimulator`. * Renamed likelihoods to be more explicit. Reparameterized the Gaussian likelihood in terms of standard deviation for consistency. Added and updated documentation and annotations. * Updated type annotations. Added ABC to abstract classes. * Added override decorator as appropriate. Updated operations on dictionaries of unknown parameters to have consistent usage of keys when iterating over them. * Added validation upon construction for only using a `Gaussian` likelihood with an `EnsembleKalmanFilterSimulator`. * Renamed likelihoods to be more explicit. Reparameterized the Gaussian likelihood in terms of standard deviation for consistency. Added and updated documentation and annotations. * Updated line formatting. * Updated documentation. * Changed validation of dynamic parameters to work properly with array-valued hyperparameters. * Changed the `posterior_values` of the particle filter and EnKF to have "realizations" as the first dimension. * Forecasting code cleanup (#293) * Plotting functionality. * Error correction. * Typing * modified: epymorph/forecasting/filter_plot.py * Finally? * EnKF refactor (#294) * Refactor filter to reduce code repetition. * Added support for non-Gaussian likelihoods in the EnKF. * Added support for observing multiple strata. * Allow unknown params to use wildcards. * Refactor filter to reduce code repetition. * Added support for non-Gaussian likelihoods in the EnKF. * Added support for observing multiple strata. * Allow unknown params to use wildcards. * Cleaned up redundant shape calculations. * Messaging and refactor of pipeline simulators. (#295) * Refactor filter code. * Moved pipeline_messaging * Typing updates. * Updated documentation. * Formatting. * Reorganized internal forecasting utility functions. * Updated typing in FilterOutput. * Added support for movement data by visit or home node in pipeline simulators. * Typing and doc improvements in the munge. * modified: tests/fast/tools/data_test.py * modified: epymorph/forecasting/munge_realizations.py * Updated typing, documentation, and naming conventions for pipeline plots. * Fixed incorrect import. * Adjusted typing for plotting on multiple matplotlib axes. * Updated documentation and typing. --------- Co-authored-by: Avery Drennan <aad473@nau.edu> Co-authored-by: averydx <avery.drennan@gmail.com>
…gs cycle over the geos or the quantities in *_plt functions. The notebooks plotting_example.ipynb and pf_v_enkf.ipynb contain a number of examples. Note these notebooks should be removed before final merge.
|
I noticed some issues with the way I was deleting yticks from unused subplots. If |
|
The notebooks for testing various plots are linked below. |
JavadocMD
left a comment
There was a problem hiding this comment.
Whoops, I forgot to "start review" with the above comments, but see above comments. I think some of the guidance on docstring style should be applied broadly across the different plot functions.
…ctions. Docstrings have been updated, and some small refactors have been made.
|
|
||
| return ax_list | ||
|
|
||
| def spaghetti( |
There was a problem hiding this comment.
Docstring describes spaghetti plot as "Produces a spaghetti plot of a filter output. This is a plot where each realization corresponds to a specific line on a plot." I worry this isn't clear enough for users not already familiar with the plot -- is there a better phrasing?
| @@ -279,9 +315,11 @@ def spaghetti_plt( | |||
| quantity: QuantityStrategy | ParameterStrategy, | |||
| *, | |||
| legend: LegendOption = "auto", | |||
There was a problem hiding this comment.
Discussion: The basic Output plot renderer doesn't accept legend as an option in its "_plt" variant, assuming the user will be happy to draw the legend themselves if they're using the plt version. I don't have very strong opinions about which of these is correct, but I feel like it should be consistent. What do you think?
|
|
||
| return num_nodes | ||
|
|
||
| def _promote_axs(self, axs): |
| # Any other combo doesn't need to be or can't be mapped. | ||
| return actual, identity | ||
|
|
||
| def _check_num_nodes(self, geo): |
There was a problem hiding this comment.
I believe this is not correctly handling GeoSelections (sans grouping or aggregation), and I'd suggest making this a GeoStrategy method.
This branch contains the KDE plot and tweaks allowing the user to choose whether to cycle the kwargs over the geo or quantity. The notebooks plotting_example.ipynb and pf_v_enkf.ipynb show a number of examples of plots in action.
Note these notebooks need to be removed before merge commit.