-
-
Notifications
You must be signed in to change notification settings - Fork 668
Create a base processed variable class #5076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a base processed variable class #5076
Conversation
…sed to computed variable.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #5076 +/- ##
========================================
Coverage 99.12% 99.12%
========================================
Files 304 305 +1
Lines 23576 23608 +32
========================================
+ Hits 23369 23401 +32
Misses 207 207 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, thanks @pipliggins, just a pedantic suggestion on the method name below
Description
This PR addresses an issue encountered when using
first_state
orlast_state
solution objects with theoutput_variables
option in the IDAKLU solver - for example, when supplying an starting solution to .solve() within an experiment.When adding a
first_state
orlast_state
solution to a new solution computed with theoutput_variables
option, a conflict arises due to the differing types of processed variables:ProcessedVariable
objects on demand.ComputedProcessedVariable
objects.These two classes currently share no functionality and cannot interoperate. Consequently, attempting to combine them to form a new solution results in failure.
This PR introduces a new abstract base class for both
ProcessedVariable
andComputedProcessedVariable
, providing a shared_update()
method. This enables consistent combination of these objects when merging solutions. The concatenated object is always aComputedProcessedVariable
, since converting to aProcessedVariable
is not viable - it requires access to the full state vector, which is unavailable whenoutput_variables
is used.Fixes #4743
Important checks:
Please confirm the following before marking the PR as ready for review:
nox -s pre-commit
nox -s tests
nox -s doctests