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
Functions
The default method for merging site units. |
|
Create a dictionary for default depth of merged units |
|
|
Export merged rock-unit property data for a site to YAML files. |
|
Build and export a merged YAML file describing a geological site's layers. |
|
Export a YAML file describing the depths of a geological site's layers. |
|
Load a YAML configuration file |
|
Validate that all required fields are present in the config. |
|
Load and validate, a site configuration file. Save rock, site, geometry data with output paths given via CLI. |
|
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:
- 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:
- 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.
- 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.
- smart_data_hub.export_data.REQUIRED_FIELDS = ['site_name', 'tag_dict', 'sampling_functions_by_property'][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:
FileNotFoundError – not found message.
ValueError – empty config file message.
- Returns:
configuration dictionary.
- Return type:
- 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: