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
Proposing a user-extensible output module. The basic idea is that a user can pass either a set of default or derived-type classes which encapsulates how to record data to disk. For instance, suppose we have a default writer type
The __init__ and finalize methods take care of maintaining a reference to the output file. The write_step method would be what is called during model runtime. E.g., in a proposed model physics loop:
output_handler=OutputWriter("my_output.csv")
whilet<t_end:
model.step()
if ( output_step ):
output_handler.write_step(model.state)
t+=dt
Then any output handlers simply need to implement the interface. Ideally, the write_step file would incrementally add to a file.
The text was updated successfully, but these errors were encountered:
Proposing a user-extensible output module. The basic idea is that a user can pass either a set of default or derived-type classes which encapsulates how to record data to disk. For instance, suppose we have a default writer type
The
__init__
andfinalize
methods take care of maintaining a reference to the output file. Thewrite_step
method would be what is called during model runtime. E.g., in a proposed model physics loop:Then any output handlers simply need to implement the interface. Ideally, the
write_step
file would incrementally add to a file.The text was updated successfully, but these errors were encountered: