Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
era5-tables
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bm1159
cosodax
era5-tables
Commits
ada594e7
Commit
ada594e7
authored
6 days ago
by
Etor Lucio Eceiza
Browse files
Options
Downloads
Patches
Plain Diff
fix: add info in docstrings
parent
91719371
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/era5_tables/converter.py
+13
-3
13 additions, 3 deletions
src/era5_tables/converter.py
with
13 additions
and
3 deletions
src/era5_tables/converter.py
+
13
−
3
View file @
ada594e7
...
...
@@ -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
"
)):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment