FolderProjectIo
- class glotaran.builtin.io.folder.folder_plugin.FolderProjectIo(format_name: str)[source]
Bases:
ProjectIoInterface
Project Io plugin to save result data to a folder.
There won’t be a serialization of the Result object, but simply a markdown summary output and the important data saved to files.
Initialize a Project IO plugin with the name of the format.
- Parameters:
format_name (str) – Name of the supported format an instance uses.
Methods Summary
Create a Model instance from the specs defined in a file.
Create a Parameters instance from the specs defined in a file.
Create a Result instance from the specs defined in a file.
Create a Scheme instance from the specs defined in a file.
Save a Model instance to a spec file.
Save a Parameters instance to a spec file.
Save the result to a given folder.
Save a Scheme instance to a spec file.
Methods Documentation
- load_model(file_name: str) Model
Create a Model instance from the specs defined in a file.
NOT IMPLEMENTED
- load_parameters(file_name: str) Parameters
Create a Parameters instance from the specs defined in a file.
NOT IMPLEMENTED
- Parameters:
file_name (str) – File containing the parameter specs.
- Returns:
Parameters instance created from the file.
- Return type:
- load_result(result_path: str) Result
Create a Result instance from the specs defined in a file.
NOT IMPLEMENTED
- load_scheme(file_name: str) Scheme
Create a Scheme instance from the specs defined in a file.
NOT IMPLEMENTED
- Parameters:
file_name (str) – File containing the parameter specs.
- Returns:
Scheme – Scheme instance created from the file.
.. # noqa (DAR202)
.. # noqa (DAR401)
- save_parameters(parameters: Parameters, file_name: str)
Save a Parameters instance to a spec file.
NOT IMPLEMENTED
- Parameters:
parameters (Parameters) – Parameters instance to save to specs file.
file_name (str) – File to write the parameter specs to.
- save_result(result: Result, result_path: str, *, saving_options: SavingOptions = SavingOptions(data_filter=None, data_format='nc', parameter_format='csv', report=True), used_inside_of_plugin: bool = False) list[str] [source]
Save the result to a given folder.
Returns a list with paths of all saved items. The following files are saved if not configured otherwise: *
result.md
: The result with the model formatted as markdown text. *initial_parameters.csv
: Initially used parameters. *optimized_parameters.csv
: The optimized parameter as csv file. *parameter_history.csv
: Parameter changes over the optimization *{dataset_label}.nc
: The result data for each dataset as NetCDF file.Note
As a side effect it populates the file path properties of
result
which can be used in other plugins (e.g. theyml
save_result).- Parameters:
result (Result) – Result instance to be saved.
result_path (str) – The path to the folder in which to save the result.
saving_options (SavingOptions) – Options for saving the the result.
used_inside_of_plugin (bool) – Denote that this plugin is used from inside another plugin, if false a user warning will be thrown. , by default False
- Returns:
List of file paths which were created.
- Return type:
- Raises:
ValueError – If
result_path
is a file.