Commit 9f212c60 authored by Guillaume's avatar Guillaume
Browse files

Bugfixes

parent ea909ff9
......@@ -23,7 +23,7 @@
"table_id",
"grid_label"
],
"aggregations": [ [{% for agg in aggregations %}
"aggregations": [{% for agg in aggregations %}
{
"type": "{{ agg.type }}",
"attribute_name": "{{ agg.attribute_name }}",
......@@ -31,28 +31,6 @@
"options": "{{ agg.options }}"
{% endif %}
}{% if not loop.last %},{% endif %}
{% endfor %}],
{
"type": "union",
"attribute_name": "variable_id"
},
{
"type": "join_existing",
"attribute_name": "period_start",
"options": { "dim": "time", "coords": "minimal", "compat": "override" }
},
{
"type": "join_new",
"attribute_name": "member_id",
"options": { "coords": "minimal", "compat": "override" }
},
{
"type": "join_new",
"attribute_name": "init_year",
"options": { "coords": "minimal", "compat": "override" }
}
]
{% endfor %}]
}
}
......@@ -6,9 +6,9 @@
"""
CATALOG_OUTPUT_BACKUP = '/modfs/backup/catalog'
CATALOG_OUTPUT_PROD = '/modfs/catalog/catalog'
CATALOG_OUTPUT = '/modfs/scratch/catalog'
CATALOG_OUTPUT_BACKUP = '/modfs/backup/catalogs'
CATALOG_OUTPUT_PROD = '/modfs/catalog/catalogs'
CATALOG_OUTPUT = '/modfs/scratch/catalogs'
IPSL_DATA_ROOT = '/bdd/'
......
......@@ -239,7 +239,7 @@ def main():
_ = [x for x in processes]
# Write JSON catalog.
make_json(CATALOG_OUTPUT_PROD + JSON_EXTENSION, args.project, header)
make_json(CATALOG_OUTPUT_PROD, args.project, header)
# Concatenate CSV files into one compressed CSV catalog.
print(f'Concatenating CSV catalogs...')
......
......@@ -28,7 +28,7 @@ def make_csv(catpath, entries):
f.write(','.join(line) + '\n')
def make_json(catpath, project, header):
def make_json(catdir, project, header):
"""
ESM JSON catalog templating based on Jinja2.
......@@ -36,7 +36,7 @@ def make_json(catpath, project, header):
print(f'Writing JSON catalog...')
# Get catalog name.
catname = os.path.basename(catpath)
catpath = os.path.join(catdir, f'{project}{JSON_EXTENSION}')
# Load Jinja2 template for ESM catalogs.
with open('ESMCollectionTemplate.json') as file:
......@@ -45,9 +45,9 @@ def make_json(catpath, project, header):
# Set template content.
content = dict()
content['esmcat_version'] = '0.1.0'
content['id'] = os.path.splitext(catname)[0]
content['id'] = os.path.splitext(catpath)[0]
content['description'] = CATALOG_DESCRIPTION_TEMPLATE.format(project)
content['catalog_file'] = os.path.splitext(catname)[0] + CSV_EXTENSION
content['catalog_file'] = os.path.splitext(catpath)[0] + CSV_EXTENSION
content['attributes'] = list()
for facet in header[2:]:
attr = dict()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment