Commit 2813b365 authored by Guillaume's avatar Guillaume
Browse files

Enable init_year for CMIP6 only

parent 57bd0d7d
......@@ -67,11 +67,10 @@ class Process(object):
facets.update(drs.get_facets_from_filename(path.stem))
# Extract CMIP6 DCPP initial year.
match = re.match(re.compile(INIT_YEAR_REGEX.format(AGGREGATION_MEMBER['CMIP6'])),
facets[AGGREGATION_MEMBER[self.project]])
facets.update({k: ('' if v is None else v) for k, v in match.groupdict().items()})
facets['init_year'] = match.groupdict()['init_year'] if match else ''
if self.project == 'CMIP6':
match = re.match(re.compile(INIT_YEAR_REGEX.format(AGGREGATION_MEMBER['CMIP6'])),
facets[AGGREGATION_MEMBER[self.project]])
facets.update({k: ('' if v is None else v) for k, v in match.groupdict().items()})
# If facet dict is empty, go to next line/path.
if not facets:
......@@ -202,8 +201,9 @@ def main():
# Build CSV header.
header = ['path', 'project']
header.extend(drs.dir_keys)
header.extend(['init_year',
'period_start',
if args.project == 'CMIP6':
header.append('init_year')
header.extend(['period_start',
'period_end',
'climatology',
'latest'])
......
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