coecms / clef

https://clef.readthedocs.io
7 stars 3 forks source link

fix for CMIP6 files with wrong member_id create issue with CMIP5 #143

Closed paolap closed 4 years ago

paolap commented 4 years ago

Calling this in post_local function for CMIP5 generate a 'member_id' key error:

if any(x in row['member_id'] for x in ['r0','i0','p0','f0']): row['member_id'] = get_member(row['path'])

variant_labele could actually be different if sub-experiment present but for the moment this should be ok

    row['variant_label'] = row['member_id']

Simply checking if 'f' which is not available for CMIP5 is one of the keys fixes it

if 'f' in row.keys() and any(x in row['member_id'] for x in ['r0','i0','p0','f0']): row['member_id'] = get_member(row['path'])

variant_labele could actually be different if sub-experiment present but for the moment this should be ok

    row['variant_label'] = row['member_id']

branch postlocalbug commit https://github.com/coecms/clef/commit/0e0a96e82f1282e48bdcf4923dc7e3727ea7695f