Skip to content
Snippets Groups Projects
Commit ada594e7 authored by Etor Lucio Eceiza's avatar Etor Lucio Eceiza
Browse files

fix: add info in docstrings

parent 91719371
No related branches found
No related tags found
No related merge requests found
......@@ -142,8 +142,7 @@ def _get_mapping_source(cmip_val, source_table: Optional[str] = "") -> str:
The mapping goes as follows in order of priority: Obs4MIPs, CMIP6, CF,
ECMWF. When possible it looks at Obs4MIPs tables, then CMIP6, if not it
relies on the CF CV that was manually written in the csv file. Finally,
for new
variables we resort to ECMWF naming.
for new variables we resort to ECMWF naming.
Parameters:
cmip_val (int or str): Mapping indicator value.
......@@ -540,6 +539,9 @@ def csv_to_cmor_json(
ltype (Optional[str or List[str]]): Level types to include.
clean_output (bool): Whether to clean output directory before writing.
verbose (bool): Whether to show per-variable output.
Returns:
None: The function creates JSON files in the output directory.
"""
var = _str_to_list(var)
......@@ -663,11 +665,19 @@ def harmonize_variables(
json_dir: Path = json_output_path, verbose: bool = False
) -> None:
"""
Post-process pass to fill in missing comments from higher-priority tables.
Post-process pass to fill in certain JSON values from higher-priority tables.
This function iterates through all JSON files in the specified directory and
updates the "variable_entry" and "Header" sections of each file.
Currently it only populates empty "comment" fields cross-checking among all
same variables of different frequencies.
Parameters:
json_dir (Path): Directory with generated CMOR JSON files.
verbose (bool): Enable verbose output.
Returns:
None: The function modifies the JSON files in place.
"""
grouped: dict[str, dict[str, dict]] = {}
for json_file in sorted(json_dir.glob("ERA5*.json")):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment