Skip to content

Commit

Permalink
comment out problem lines in catalog_builder as workaround for import…
Browse files Browse the repository at this point in the history
… issue
  • Loading branch information
wrongkindofdoctor authored May 30, 2024
1 parent 95b931f commit 78aa4d6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tools/catalog_builder/catalog_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

root_dir = os.path.dirname(os.path.realpath(__file__)).split('/tools/catalog_builder')[0]
sys.path.insert(0, os.path.join(root_dir, 'src'))
from src import util
# from src import util

# Define a log object for debugging
_log = logging.getLogger(__name__)
Expand Down Expand Up @@ -124,17 +124,17 @@ def parse_gfdl_am5_data(file_name: str):
gfdl_fieldlist = os.path.join(root_dir, 'data/fieldlist_CMIP.jsonc')
else:
gfdl_fieldlist = os.path.join(root_dir, 'data/fieldlist_GFDL.jsonc')
try:
json_config = util.json_utils.read_json(gfdl_fieldlist, log=_log)
except IOError:
print("Unable to open file", gfdl_fieldlist)
sys.exit(1)
gfdl_info = util.basic.NameSpace.fromDict(json_config)

if hasattr(gfdl_info.variables, variable_id):
var_metadata = gfdl_info.variables.get(variable_id)
else:
raise KeyError(f'{variable_id} not found in {gfdl_fieldlist}')
#try:
# json_config = util.json_utils.read_json(gfdl_fieldlist, log=_log)
#except IOError:
# print("Unable to open file", gfdl_fieldlist)
# sys.exit(1)
#gfdl_info = util.basic.NameSpace.fromDict(json_config)

#if hasattr(gfdl_info.variables, variable_id):
# var_metadata = gfdl_info.variables.get(variable_id)
#else:
# raise KeyError(f'{variable_id} not found in {gfdl_fieldlist}')

if hasattr(var_metadata, 'standard_name'):
standard_name = var_metadata.standard_name
Expand Down

0 comments on commit 78aa4d6

Please sign in to comment.