smart_data_hub.export_data

Script to read a site configuration YAML file.

Usage:

python read_site_config.py –config path/to/site_config.yaml –path_to_save_rock_yaml output/DE_South_Claystone/rock_data –path_to_save_site_yaml output/DE_South_Claystone/site_data –path_to_save_site_geometry output/DE_South_Claystone/geometry

Attributes

REQUIRED_FIELDS

Functions

default_merge_rock_unit()

The default method for merging site units.

default_depth_for_merged_rock_units()

Create a dictionary for default depth of merged units

export_site_merged_rock_units_yaml(site_name, ...)

Export merged rock-unit property data for a site to YAML files.

export_site_merged_yaml(site_name, ...)

Build and export a merged YAML file describing a geological site's layers.

export_site_depth_yaml(merge_unit_depth, ...)

Export a YAML file describing the depths of a geological site's layers.

parse_args()

load_site_yaml_config(config_path)

Load a YAML configuration file

validate_config(config)

Validate that all required fields are present in the config.

build_site_config(config_path, path_to_save_rock_yaml, ...)

Load and validate, a site configuration file. Save rock, site, geometry data with output paths given via CLI.

main()

Module Contents

smart_data_hub.export_data.default_merge_rock_unit()[source]

The default method for merging site units.

Returns:

default merged units

Return type:

dict

smart_data_hub.export_data.default_depth_for_merged_rock_units()[source]

Create a dictionary for default depth of merged units

Returns:

default depth of merged units.

Return type:

dict

smart_data_hub.export_data.export_site_merged_rock_units_yaml(site_name, merge_unit_rock_prop, tag_dict, sampling_functions_by_property, path_to_save_rock_yaml)[source]

Export merged rock-unit property data for a site to YAML files.

Parameters:
  • site_name (str) – Name of the site.

  • merge_unit_rock_prop (dict[str, list[str]]) – Mapping of merged unit to the rock layers that should be combined.

  • tag_dict (dict[str, list[str]]) – Tag filters applied to the site data.

  • sampling_functions_by_property (dict[str, callable]) – Mapping of property names to desired sampling functions.

  • path_to_save_yaml (str) – The path to save the output YAML files.

smart_data_hub.export_data.export_site_merged_yaml(site_name, merge_unit_rock_prop, path_to_save_site_yaml)[source]

Build and export a merged YAML file describing a geological site’s layers.

Parameters:
  • site_name (str) – Name of the site.

  • merge_unit_rock_prop (dict[str, list[str]]) – Mapping of merged unit to the rock layers that should be combined.

  • path_to_save_site_yaml (str) – Directory path where the resulting YAML file will be saved.

smart_data_hub.export_data.export_site_depth_yaml(merge_unit_depth, path_to_save_site_geometry)[source]

Export a YAML file describing the depths of a geological site’s layers.

Parameters:
  • merge_unit_depth (dict[str, float]) – Mapping of merged unit to the depth.

  • path_to_save_site_geometry (str) – Directory path where the resulting YAML file will be saved.

smart_data_hub.export_data.REQUIRED_FIELDS = ['site_name', 'tag_dict', 'sampling_functions_by_property'][source]
smart_data_hub.export_data.parse_args()[source]
smart_data_hub.export_data.load_site_yaml_config(config_path)[source]

Load a YAML configuration file

Parameters:

config_path (str) – Path to the input YAML configuration file

Raises:
Returns:

configuration dictionary.

Return type:

dict

smart_data_hub.export_data.validate_config(config)[source]

Validate that all required fields are present in the config.

Parameters:

config (dict) – configuration dictionary

Raises:

ValueError – missing required field message.

smart_data_hub.export_data.build_site_config(config_path, path_to_save_rock_yaml, path_to_save_site_yaml, path_to_save_site_geometry)[source]

Load and validate, a site configuration file. Save rock, site, geometry data with output paths given via CLI.

Parameters:
  • config_path (str) – path to the configuration file.

  • path_to_save_rock_yaml (str) – output directory for the merged rock property YAML files.

  • path_to_save_site_yaml (str) – output directory for the generated site YAML file.

  • path_to_save_site_geometry (str) – output directory for the generated site geometry file.

Returns:

configuration dictionary with output paths given via CLI.

Return type:

dict

smart_data_hub.export_data.main()[source]