Configuration File Writer API

ocw_config_runner.configuration_writer.export_evaluation_to_config(evaluation, file_path='./exported_eval.yaml')

Export an evaluation to a config file

Parameters:
  • evaluation (evaluation.Evaluation) – The evaluation object to export.
  • file_path (string) – Optional file path where the config file should be saved.
ocw_config_runner.configuration_writer.generate_dataset_config(dataset)

Generate dataset config file output for a given Dataset object.

Parameters:dataset (dataset.Dataset) – The dataset from which to extract configuration information.
Returns:dict() containing necessary information for dataset to be saved into a configuration object.
Raises:AttributeError – If dataset does not contain expected source data.
ocw_config_runner.configuration_writer.generate_dataset_information(evaluation)

Generate dataset config file output for a given Evaluation object.

Parameters:evaluation (evaluation.Evaluation) – The evaluation object from which to extract metrics.
Returns:A dict() of dataset configuration information for export to a configuration file.
Return type:dict()
ocw_config_runner.configuration_writer.generate_evaluation_information(evaluation)

Generate evaluation-related config file output.

Attempts to parse out temporal and spatial rebinning/regridding information from the supplied evaluation object. If no datasets can be found, values are defaulted to sane defaults or (potentially) excluded entirely.

It’s important to note that this function does its best to extrapolate the configuration information. It’s possible that you will encounter a scenario where the guessed values are not what you want/expect. Please double check the output before blinding trusting what this generates.

Parameters:evaluation (evaluation.Evaluation) – The evaluation object from which to extract metrics.
Returns:A dictionary of valid evaluation section settings for export to a configuration file.
Return type:dict()
ocw_config_runner.configuration_writer.generate_metric_information(evaluation)

Generate metric config file output from a given Evaluation object.

Parameters:evaluation (evaluation.Evaluation) – The evaluation object from which to extract metrics.
Returns:A list() of metrics object names for output into a configuration file.
Return type:list() of metrics
ocw_config_runner.configuration_writer.generate_subregion_information(evaluation)

Generate subregion config file output from a given Evaluation object.

Parameters:evaluation (evaluation.Evaluation) – The evaluation object from which to extract metrics.
Returns:A list() of list() objects containing bounding box info for export into a configuration file
Return type:list() of list()