-
Notifications
You must be signed in to change notification settings - Fork 29
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
More generic API for output files #256
Comments
This looks like a good change from my point of view. I like the idea of the the time_list (v. useful for tidal sims with spin-up). It would be useful to add multiple fields to the same file. What if you (for some reason!) wanted multiple output types? Could you do multiple .add_exports? Or is there an implied restriction of one file type, field, output times, etc per simulation? |
Good point, there's no restriction on how many options.add_export(['elev_2d'], 'vtk', time_list=np.linspace(...)) # for visualization
options.add_export(['elev_2d', 'uv_2d'], 'hdf5', interval=24*3600.) # daily checkpoints
options.add_export(['elev_2d', 'uv_2d'], 'netcdf', interval=3600.) # outputs to share
I tend to agree. Need to give that some thought. One solution is to add |
We could handle different function space by either a project under the hood, with warning, or an error and ask user to specify multiple files - one per function space. Either is fine (though latter is probably cleaner). |
Yes, this probably depends on the file format as well. Firedrake's VTK |
Also, this output API would imply deprecation of options options.simulation_export_time
options.fields_to_export
options.fields_to_export_hdf5 I'm inclined to think that we'd still keep |
Currently outputs are defined by the following options:
We need a more general way to declare model outputs. The new API could be:
field_list
list of field to export, e.g.['elev_2d', 'uv_2d']
export_type
specifies the output file type, currently'vtk'
or'hdf5'
interval
is the export interval in secondstime_list
alternatively, user can provide a list of export times e.g.[100, 110, 120]
. Seconds since the beginning of the simulation.initial_only
is equivalent tointerval=None
andtime_list=[0]
output_directory
optionally the user can specify a different output directoryExamples:
There are some corner cases that need to be checked, for example if the user speficies two exports that write to the same file, we should raise an error:
Is this sufficient? Are there other use cases that should be considered?
The above proposal does not handle:
The text was updated successfully, but these errors were encountered: