Skip to content

Forecasting code cleanup#285

Open
JeffreyCovington wants to merge 14 commits into2.0-betafrom
Forecasting-Code-Cleanup
Open

Forecasting code cleanup#285
JeffreyCovington wants to merge 14 commits into2.0-betafrom
Forecasting-Code-Cleanup

Conversation

@JeffreyCovington
Copy link
Copy Markdown
Contributor

Miscellaneous cleanup which includes:

  • Renaming likelihoods to be more explicit.
  • Adding more validation checks.
  • Adding better type annotations.
  • Adding and updating documentation.
  • Fixing typos.

Includes ForecastSimulator, ParticleFilterSimulator, and EnsembleKalmanFilterSimulator as top-level interfaces.
…naries of unknown parameters to have consistent usage of keys when iterating over them.
…hood with an `EnsembleKalmanFilterSimulator`.
… likelihood in terms of standard deviation for consistency. Added and updated documentation and annotations.
…naries of unknown parameters to have consistent usage of keys when iterating over them.
…hood with an `EnsembleKalmanFilterSimulator`.
… likelihood in terms of standard deviation for consistency. Added and updated documentation and annotations.
Copy link
Copy Markdown
Contributor

@JavadocMD JavadocMD left a comment

Choose a reason for hiding this comment

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

Looking much better, thanks! Just a few minor things, see inline.

@Averydx
Copy link
Copy Markdown

Averydx commented Apr 10, 2026

Is it possible to split up some of the code in pipeline.py? I'm having difficulties with the dreaded circular imports. For example some of the dataclasses I'm using for type hinting like UnknownParam and PipelineOutput.

@JavadocMD
Copy link
Copy Markdown
Contributor

Is it possible to split up some of the code in pipeline.py?

There are a number of tricks to accomplish this. For instance, notice the epymorph.tools.data module defines its own Output as a Protocol rather than importing the real Output from epymorph.simulator.basic.output. Breaking out of circular imports was the main reason for doing that.

You can also move certain foundational entities to a third module, if they don't require many imports themselves.

There are certain guidelines that can help organize imports; I thought about enforcing them with tools at one point. Anyway, I'm happy to chat about specifics if it's helpful.

@Averydx
Copy link
Copy Markdown

Averydx commented Apr 10, 2026

Thank you! That’s very helpful.

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.

3 participants