-
Notifications
You must be signed in to change notification settings - Fork 188
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
New Simulation API: more callbacks, less "progress" #1971
Conversation
Well, we are almost done with #1138 but not quite. We still need to nuke |
hm... shall I have a look? seems like test are failing? |
:) |
I think the tests are failing because of some detail about how the simulations are stopped / time-step is aligned at the end of a run --- the overall design can be reviewed! |
@tomchor @navidcy @simone-silvestri can any of you help review this PR? |
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.
This is looking good! Thanks for going through all this effort.
This PR is definitely too big and complex for me fully grasp the details, but I helped with some minor comments wherever I could.
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.
If tests pass go for it
Awesome PR! Quick question: did we skip version 0.64? I seems like this PR bumped the version from 0.63.4 to 0.65. |
That was a mistake, so I'll bump back to 0.64... |
Could someone take a look at this related comment? #1895 (comment) I would argue in favor of restoring the "parameters" argument or an alternative way of passing additional parameters to the callback function. |
This PR overhauls the API for
Simulation
,TimeStepWizard
, and printing of progress. It also simplifies the implementation ofrun!
.After this PR,
Simulation
no longer accepts the keyword argumentsiteration_interval
orprogress
. Instead, progress printing is achieved with callbacks, eg:It also refactors the
TimeStepWizard
so that it can be used as a callback, egThis is a better design for a few reasons:
schedule
(rather than onlyIterationInterval
).simulation.Δt
. No more shenanigans likesimulation.Δt.Δt
.Eventually, we should also eliminate the "diagnostics" list so that we have only two lists of callback-like objects:
simulation.callbacks
andsimulation.output_writers
.I think this resolves an issue or two but I need to find them. Also, I've so far only updated the examples. There are probably tests and validation cases that need to be updated for the new API as well.
This PR is an important step toward generalizing
Oceananigans.Simulation
so that it can be used byClimaAtmos.jl
. cc @bischtob @akshaysridhar