Disclaimer: in this issue I propose a small bug fix that works, but I haven't understood the origin of the problem at the moment but wanted to report my bug tracking tests here
I've tried to build an ensemble with .explore('ensemble') with climaf 1.2.10 but I get an error:
common_dict = dict(project='CMIP6', model='IPSL-CM6A-LR',
experiment='historical', period='*', realization='*')
tas_req = ds(variable='tas', table='Amon', **common_dict)
tas_ens = tas_req.explore('ensemble')
clog('debug')
summary(tas_ens)
error : "Order list does not match dict keys list : ['r10i1p1f1', 'r11i1p1f1', 'r12i1p1f1', 'r13i1p1f1', 'r14i1p1f1', 'r15i1p1f1', 'r16i1p1f1', 'r17i1p1f1', 'r18i1p1f1', 'r19i1p1f1', 'r1i1p1f1', 'r20i1p1f1', 'r21i1p1f1', 'r22i1p1f1', 'r23i1p1f1', 'r24i1p1f1', 'r25i1p1f1', 'r26i1p1f1', 'r27i1p1f1', 'r28i1p1f1', 'r29i1p1f1', 'r2i1p1f1', 'r30i1p1f1', 'r31i1p1f1', 'r3i1p1f1', 'r4i1p1f1', 'r5i1p1f1', 'r6i1p1f1', 'r7i1p1f1', 'r8i1p1f1', 'r9i1p1f1'] and ['r1i1p1f1', 'r2i1p1f1', 'r3i1p1f1', 'r4i1p1f1', 'r5i1p1f1', 'r6i1p1f1', 'r7i1p1f1', 'r8i1p1f1', 'r9i1p1f1', 'r10i1p1f1', 'r11i1p1f1', 'r12i1p1f1', 'r13i1p1f1', 'r14i1p1f1', 'r15i1p1f1', 'r16i1p1f1', 'r17i1p1f1', 'r18i1p1f1', 'r19i1p1f1', 'r20i1p1f1', 'r21i1p1f1', 'r22i1p1f1', 'r23i1p1f1', 'r24i1p1f1', 'r25i1p1f1', 'r26i1p1f1', 'r27i1p1f1', 'r28i1p1f1', 'r29i1p1f1', 'r30i1p1f1', 'r31i1p1f1']"
---------------------------------------------------------------------------
Climaf_Classes_Error Traceback (most recent call last)
<ipython-input-11-d9dc17d52d05> in <module>()
----> 1 tas_ens = tas_req.explore('ensemble')
2 clog('debug')
3 summary(tas_ens)
/ciclad-home/jservon/Evaluation/CliMAF/climaf_installs/climaf_1.2.10/climaf/classes.pyc in explore(self, option, group_periods_on, operation, first)
680 #print "dic=",dic
681 self.files=files
--> 682 return eds(first=first,**dic)
683 elif option == 'check_and_store' :
684 for kw in wildcards:
/ciclad-home/jservon/Evaluation/CliMAF/climaf_installs/climaf_1.2.10/climaf/classes.pyc in eds(first, **kwargs)
1125 attval2[attr]=member
1126 d[member]=cdataset(**attval2)
-> 1127 return cens(d,order=attval[attr])
1128 else :
1129 # Must construct the cartesian product of all list-type attributes
/ciclad-home/jservon/Evaluation/CliMAF/climaf_installs/climaf_1.2.10/climaf/classes.pyc in __init__(self, dic, order, sortfunc)
990 except :
991 keylist.sort()
--> 992 if order : self.set_order(order,keylist)
993 elif sortfunc : self.order=sortfunc(keylist)
994 else : self.order=keylist
/ciclad-home/jservon/Evaluation/CliMAF/climaf_installs/climaf_1.2.10/climaf/classes.pyc in set_order(self, order, ordered_keylist)
1004 raise Climaf_Classes_Error(
1005 "Order list does not match dict keys list : %s and %s"%
-> 1006 (`ordered_list`,`ordered_keylist`))
1007 self.order=order
1008
Climaf_Classes_Error: "Order list does not match dict keys list : ['r10i1p1f1', 'r11i1p1f1', 'r12i1p1f1', 'r13i1p1f1', 'r14i1p1f1', 'r15i1p1f1', 'r16i1p1f1', 'r17i1p1f1', 'r18i1p1f1', 'r19i1p1f1', 'r1i1p1f1', 'r20i1p1f1', 'r21i1p1f1', 'r22i1p1f1', 'r23i1p1f1', 'r24i1p1f1', 'r25i1p1f1', 'r26i1p1f1', 'r27i1p1f1', 'r28i1p1f1', 'r29i1p1f1', 'r2i1p1f1', 'r30i1p1f1', 'r31i1p1f1', 'r3i1p1f1', 'r4i1p1f1', 'r5i1p1f1', 'r6i1p1f1', 'r7i1p1f1', 'r8i1p1f1', 'r9i1p1f1'] and ['r1i1p1f1', 'r2i1p1f1', 'r3i1p1f1', 'r4i1p1f1', 'r5i1p1f1', 'r6i1p1f1', 'r7i1p1f1', 'r8i1p1f1', 'r9i1p1f1', 'r10i1p1f1', 'r11i1p1f1', 'r12i1p1f1', 'r13i1p1f1', 'r14i1p1f1', 'r15i1p1f1', 'r16i1p1f1', 'r17i1p1f1', 'r18i1p1f1', 'r19i1p1f1', 'r20i1p1f1', 'r21i1p1f1', 'r22i1p1f1', 'r23i1p1f1', 'r24i1p1f1', 'r25i1p1f1', 'r26i1p1f1', 'r27i1p1f1', 'r28i1p1f1', 'r29i1p1f1', 'r30i1p1f1', 'r31i1p1f1']"
I've had the same error when trying to build a CMIP5 multi-model ensemble:
Disclaimer: in this issue I propose a small bug fix that works, but I haven't understood the origin of the problem at the moment but wanted to report my bug tracking tests here
I've tried to build an ensemble with .explore('ensemble') with climaf 1.2.10 but I get an error:
I've had the same error when trying to build a CMIP5 multi-model ensemble:
In classes.py, I've replaced return cens(d,order=attval[attr]) with return cens(d) and the error disappears, and I get my ensemble (and it is sorted).
But the origin of the error is still not clear.
I've played a bit with the dictionary d used in classes.py to build the ensemble. It looked like this:
From this dictionary, I can make an ensemble with cens:
but if I specify the order, I get the original error:
I've tried to create a small ensemble manually and set a different order than the natural one, and it works:
It also works if I specify the order with test.keys():
Just for information:
The problem thus doesn't come from the use of order...