rigoudyg / climaf

CliMAF - a Climate Model Analysis Framework - doc at : http://climaf.readthedocs.org/
Other
16 stars 7 forks source link

Typo in the error message send by ds #234

Open oliviermarti opened 2 years ago

oliviermarti commented 2 years ago

I define a dataset with an error (the variable does not exists) :

>>> tt = ds ( **{'project': 'IGCM_OUT', 'simulation': 'CM5A2-VLR-pi-Par01', 'variable': 'flat', 'period': '6020-6099', 'domain': 'global', 'root': '/thredds/tgcc/store', 'login': 'p86mart', 'model': 'IPSLCM5A2', 'status': 'PROD', 'experiment': 'piControl', 'DIR': 'SRF', 'OUT': 'Analyse', 'ave_length': '*', 'frequency': 'monthly', 'clim_period': '????_????', 'clim_period_length': '*', 'filenameVar': 'histmth'} )

Then I run cfile

>>> cfile(tt)
warning  : no file found for {'project': 'IGCM_OUT', 'simulation': 'CM5A2-VLR-pi-Par01', 'variable': 'flat', 'period': 6020-6099, 'domain': 'global', 'root': '/thredds/tgcc/store', 'login': 'p86mart', 'model': 'IPSLCM5A2', 'status': 'PROD', 'experiment': 'piControl', 'DIR': 'SRF', 'OUT': 'Analyse', 'ave_length': '*', 'frequency': 'monthly', 'clim_period': '????_????', 'clim_period_length': '*', 'filenameVar': 'histmth'}, at these data locations ...

This printed dictionary has no quote around the value of 'period'. A copy/paste in a python shell generates strange errors that can puzzle the error : it computes period=6020-6099=-79 and a strange error about erroneous date pops up !

Olivier

senesis commented 2 years ago

It is not really a typo : period is stored as an object (and not a string), and it's print method prints a string representation of the period. But your use case shows that surrounding it with quotes could be helpful.

Le 15 décembre 2021 17:05:38 CET, Marti @.***> a écrit :

I define a dataset with an error (the variable does not exists) :

>>> tt = ds ( **{'project': 'IGCM_OUT', 'simulation':
'CM5A2-VLR-pi-Par01', 'variable': 'flat', 'period': '6020-6099',
'domain': 'global', 'root': '/thredds/tgcc/store', 'login': 'p86mart',
'model': 'IPSLCM5A2', 'status': 'PROD', 'experiment': 'piControl',
'DIR': 'SRF', 'OUT': 'Analyse', 'ave_length': '*', 'frequency':
'monthly', 'clim_period': '????_????', 'clim_period_length': '*',
'filenameVar': 'histmth'} )

Then I run cfile

>>> cfile(tt)
warning  : no file found for {'project': 'IGCM_OUT', 'simulation':
'CM5A2-VLR-pi-Par01', 'variable': 'flat', 'period': 6020-6099,
'domain': 'global', 'root': '/thredds/tgcc/store', 'login': 'p86mart',
'model': 'IPSLCM5A2', 'status': 'PROD', 'experiment': 'piControl',
'DIR': 'SRF', 'OUT': 'Analyse', 'ave_length': '*', 'frequency':
'monthly', 'clim_period': '????_????', 'clim_period_length': '*',
'filenameVar': 'histmth'}, at these data locations ...

This printed dictionary has no quote around the value of 'period'. A copy/paste in a python shell generates strange errors that can puzzle the error : it computes period=6020-6099=-79 and a strange error about erroneous date pops up !

Olivier

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rigoudyg/climaf/issues/234

-- Stéphane Sénési