YmlProjectIo
- class glotaran.builtin.io.yml.yml.YmlProjectIo(format_name: str)[source]
Bases:
ProjectIoInterface
Plugin for YAML project io.
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
Load a
Model
from a model specification in a yaml file.Load
Parameters
instance from the specification defined infile_name
.Create a
Result
instance from the specs defined in a file.Load
Scheme
instance from the specification defined infile_name
.Save a
Model
instance to a specification file.Save a Parameters instance to a spec file.
Write a
Result
instance to a specification file and data files.Write a
Scheme
instance to a specification filefile_name
.Methods Documentation
- load_model(file_name: str) Model [source]
Load a
Model
from a model specification in a yaml file.- Parameters:
file_name (str) – Path to the model file to read.
- Raises:
ValueError – If
megacomplex
was not provided in the model specification.ValueError – If
default_megacomplex
was not provided and any megacomplex is missing the type attribute.
- Return type:
- load_parameters(file_name: str) Parameters [source]
Load
Parameters
instance from the specification defined infile_name
.- Parameters:
file_name (str) – File containing the parameter specification.
- Return type:
- load_result(result_path: str) Result [source]
Create a
Result
instance from the specs defined in a file.
- load_scheme(file_name: str) Scheme [source]
Load
Scheme
instance from the specification defined infile_name
.
- 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)) list[str] [source]
Write a
Result
instance to a specification file and data files.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. *result.yml
: Yaml spec file of the result *model.yml
: Model spec file. *scheme.yml
: Scheme spec file. *initial_parameters.csv
: Initially used parameters. *optimized_parameters.csv
: The optimized parameter as csv file. *parameter_history.csv
: Parameter changes over the optimization *optimization_history.csv
: Parsed table printed by the SciPy optimizer *{dataset_label}.nc
: The result data for each dataset as NetCDF file.- Parameters:
result (Result) –
Result
instance to write.result_path (str) – Path to write the result data to.
saving_options (SavingOptions) – Options for saving the the result.
- Returns:
List of file paths which were created.
- Return type: