Skip to content
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

Calculate summary variables only when they are called #4058

Open
rtimms opened this issue May 1, 2024 · 2 comments · May be fixed by #4621
Open

Calculate summary variables only when they are called #4058

rtimms opened this issue May 1, 2024 · 2 comments · May be fixed by #4621
Assignees

Comments

@rtimms
Copy link
Contributor

rtimms commented May 1, 2024

As discussed in #3995

  • create a SummaryVariable object that saves solution.last_state and uses it to calculate the esoh variables only when they are called (the same way as Solution calculates the variables only when they are called)
  • allow users to pass in functions that calculate summary variables based on other variables
@pipliggins
Copy link
Contributor

@rtimms reading through #3995 it looks like the decision was to not allow users to define their own summary variables, have I got that right?

@rtimms
Copy link
Contributor Author

rtimms commented Nov 28, 2024

If we just keep summary variables as a list then I think defining your own summary variables is hard. Right now the summary variables just calculate the value of the variable at the last time point, and then change in that variable.

We could do something more complicated like pass in functions that take a solution and perform some operation to get a summary variable, but I'm not sure there is a strong use case for this. It can always be done as a post-processing step. If you only want the last value of some quantity then users can add custom variables to the model and then add that to the list of summary variables.

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 a pull request may close this issue.

2 participants