Closed jservonnat closed 5 years ago
The issue is slightly more complex : explore('resolve') must consider all aliases for the dataset's project, for translating each variable name found in filenames to the canonical variable name. This is what I try in attached changed code. Could you test it on your case ? classes.py
The test didn't fit my needs. I've made a fix in classes.py that works, let me know what you think about it: First, just after self.kvp.copy(), I save the requested variable (req_var):
dic=self.kvp.copy()
req_var = dic["variable"]
And use it just before the call to ds() to update the dictionnary:
# -- Use the requested variable instead of the aliased
if self.alias :
dic["variable"]=req_var
#
return ds(**dic)
OK. Coded for next release (1.2.11)
Done
I've encountered an issue when using .explore('resolve') (that I'm currently trying to use systematically in the C-ESM-EP) on an aliased variable.
For example with tauu aliased to taux, when I want to get a tauu dataset and use explore('resolve') to complete the wildcards:
I got:
The attribute variable is updated with the aliased variable name (the one that is actually in the file). The problem appears downstream, when for instance I want to make ensemble statistics: the file contains the variable taux, and not tauu.
I would recommend to not update the attribute variable (as for frequency, that is not updated) with the method explore('resolve').
What do you think?