Skip to content

Commit 5a9d638

Browse files
authored
Merge pull request #116 from NOAA-GFDL/89-cesm
New 89 cesm
2 parents 05e41f1 + 82ed156 commit 5a9d638

File tree

7 files changed

+23
-5
lines changed

7 files changed

+23
-5
lines changed

.github/workflows/conda-pkg-extra-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
conda config --append channels conda-forge
1818
conda config --append channels noaa-gfdl
1919
conda install conda-build conda-verify
20+
conda remove --name base conda-anaconda-telemetry
2021
conda build .
2122
- name: Run additional utilities as tests
2223
run: |

.github/workflows/test-pip-install-run-pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Set up Python 3.10
1414
uses: actions/setup-python@v5
1515
with:
16-
python-version: '3.10'
16+
python-version: '3.11'
1717

1818
- name: Install pip package
1919
run: |

catalogbuilder/intakebuilder/dat/gfdlcmipfreq.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
monthly:
22
frequency: mon
3+
h0:
4+
frequency: mon
5+
h2:
6+
frequency: day
37
daily:
48
frequency: day
59
hourly:

catalogbuilder/intakebuilder/getinfo.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ def getInfoFromGFDLFilename(filename,dictInfo,configyaml):
130130
dictInfo["table_id"] = "fx"
131131
return dictInfo
132132

133+
def getRealm(dictInfo):
134+
realm = ""
135+
if (dictInfo["source_id"] == "cam"):
136+
realm = "atmos"
137+
dictInfo["realm"] = realm
138+
return(dictInfo)
139+
133140
def getInfoFromGFDLDRS(dirpath,projectdir,dictInfo,configyaml,variable_id):
134141
'''
135142
Returns info from project directory and the DRS path to the file
@@ -184,6 +191,10 @@ def getInfoFromGFDLDRS(dirpath,projectdir,dictInfo,configyaml,variable_id):
184191
logger.debug("This is likely static")
185192
dictInfo["cell_methods"] = ""
186193
dictInfo["member_id"] = ""
194+
#CAM ESM: If realm is empty, ensure if there is a helper utility to populate this
195+
196+
if("realm" not in dictInfo.keys()):
197+
dictInfo = getRealm(dictInfo)
187198
return dictInfo
188199

189200
def getInfoFromDRS(dirpath,projectdir,dictInfo):
@@ -217,6 +228,7 @@ def getInfoFromVarAtts(fname,variable_id,dictInfo,att="standard_name",filexra=No
217228
:return: dictInfo with all variable atts
218229
'''
219230
#try:
231+
220232
filexr,filexra = return_xr(fname)
221233
if (dictInfo[att] == "na"):
222234
try:

catalogbuilder/intakebuilder/gfdlcrawler.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def crawlLocal(projectdir, dictFilter,dictFilterIgnore,configyaml,slow):
5454
missingcols = [col for col in diffcols if col not in set_ftemplate]
5555
missingcols.remove("path") #because we get this anyway
5656
logger.debug("Missing cols from metadata sources:"+ (str)(missingcols))
57-
5857
#Creating a dictionary to track the unique datasets we come across when using slow mode
5958
#The keys are the standard names and the values are lists tracking var_id,realm,etc..
6059
unique_datasets = {'':''}
@@ -138,7 +137,6 @@ def crawlLocal(projectdir, dictFilter,dictFilterIgnore,configyaml,slow):
138137
if qualities in unique_datasets.keys():
139138
standard_name=unique_datasets[qualities]
140139
dictInfo["standard_name"]=standard_name
141-
142140
else:
143141
logger.info("Retrieving standard_name from "+ (str)(filename))
144142
getinfo.getInfoFromVarAtts(dictInfo["path"],dictInfo["variable_id"],dictInfo)

catalogbuilder/scripts/gen_intake_gfdl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def create_catalog(input_path, output_path, config, filter_realm, filter_freq, f
123123
if not slow and 'standard_name' in headers:
124124
#If we badly need standard name, we use gfdl cmip mapping tables especially when one does not prefer the slow option. Useful for MDTF runs
125125
df = pd.read_csv(os.path.abspath(csv_path), sep=",", header=0,index_col=False)
126+
df['standard_name'] = df['standard_name'].astype(object)
126127
list_variable_id = []
127128
try:
128129
list_variable_id = df["variable_id"].unique().tolist()
@@ -144,7 +145,8 @@ def create_catalog(input_path, output_path, config, filter_realm, filter_freq, f
144145
except ValueError:
145146
continue
146147
if var is not None and realm is not None:
147-
df['standard_name'].loc[(df['variable_id'] == var) & (df['realm'] == realm) ] = v
148+
mask = (df['variable_id'] == var) & (df['realm'] == realm)
149+
df.loc[mask, 'standard_name'] = v
148150

149151
if df is not None and len(df) != 0:
150152
with open(csv_path, 'w') as csvfile:

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ dependencies = [
1616
"xarray",
1717
"pandas",
1818
"jsondiff",
19-
"intake-esm",
19+
"intake-esm ==2025.12.12",
20+
"IPython",
2021
"boto3",
2122
"polars-lts-cpu", #Hoping to remove this in the future
2223
]

0 commit comments

Comments
 (0)