You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there's a bit of cleanup to do with the interface to both Simulation and run!.
Right now run! is barebones. It will take one more argument pickup when #1082 is merged.
I think run! should have more kwargs like diagnostics, any of the stop_criteria, Δt, and progress, since these parameters are currently only used in run!. We currently require these parameters to be specified in the Simulation constructor`:
However, I think its better if we encourage them to be set in run! where they are used (producing scripts that are more "locally understandable"). Note that storing these parameters in Simulation is really a convenience feature (eg if you want to reference them after using run!, you can) rather than essential to how run! functions. This would clean up cases where users want to embed run! within a loop, because they can then write
for i =1:10run!(simulation, stop_iteration=model.clock.iteration+10)
end
or even (see below)
for i =1:10run!(simulation, stop=Iteration(model.clock.iteration+10))
end
rather than the slightly more convoluted approach (its not a lot of code, but slightly more confusing I think) that is still used in some examples.
run! might also need a make-over, since I think we should do away with iteration_interval and use AbstractSchedules for progress (or perhaps "callafter") and the TimeStepWizard.
We may also want to design AbstractCriteria that mirror the design of AbstractSchedules for stopping a simulation, so we can have a similar interface for stop criteria as output scheduling, eg something like stop=SimulationTime(1day).
I suggest we collect and discussl the extant issues we see with the current design of Simulation here.
PS do we need Simulation.parameters?
The text was updated successfully, but these errors were encountered:
I think there's a bit of cleanup to do with the interface to both
Simulation
andrun!
.Right now
run!
is barebones. It will take one more argumentpickup
when #1082 is merged.I think
run!
should have more kwargs likediagnostics
, any of thestop_criteria
,Δt
, andprogress
, since these parameters are currently only used inrun!
. We currently require these parameters to be specified in theSimulation
constructor`:Oceananigans.jl/src/Simulations/simulation.jl
Lines 51 to 60 in e1026b0
However, I think its better if we encourage them to be set in
run!
where they are used (producing scripts that are more "locally understandable"). Note that storing these parameters inSimulation
is really a convenience feature (eg if you want to reference them after usingrun!
, you can) rather than essential to howrun!
functions. This would clean up cases where users want to embedrun!
within a loop, because they can then writeor even (see below)
rather than the slightly more convoluted approach (its not a lot of code, but slightly more confusing I think) that is still used in some examples.
run!
might also need a make-over, since I think we should do away withiteration_interval
and useAbstractSchedules
forprogress
(or perhaps "callafter
") and theTimeStepWizard
.We may also want to design
AbstractCriteria
that mirror the design ofAbstractSchedules
for stopping a simulation, so we can have a similar interface for stop criteria as output scheduling, eg something likestop=SimulationTime(1day)
.I suggest we collect and discussl the extant issues we see with the current design of
Simulation
here.PS do we need
Simulation.parameters
?The text was updated successfully, but these errors were encountered: