Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepend something in front of the error message to make them easier to find #31

Open
jypeter opened this issue Nov 21, 2019 · 0 comments

Comments

@jypeter
Copy link

jypeter commented Nov 21, 2019

I'm not used yet to spotting errors in the C-ESM-EP job output (and even less used to correcting them), but it would maybe be easier to report errors if they stood out more in the output, especially when the verbose option is active

Example:

var in section_2D_maps =  {'variable': 'tas', 'table': 'Amon', 'project_specs': {'IGCM_OUT': {'DIR': 'ATM'}}, 'season': 'ANM'}
reference =>  [{'experiment': 'piControl', 'customname': 'piControl', 'ts_period': 'full', 'project': 'CMIP6', 'version': 'latest', 'frequency': 'monthly', 'realization': 'r1i1p1f1', 'model': 'IPSL-CM6A-LR', 'clim_period': 'last_200Y'}]
var_references =  [{'experiment': 'piControl', 'customname': 'piControl', 'ts_period': 'full', 'project': 'CMIP6', 'version': 'latest', 'frequency': 'monthly', 'realization': 'r1i1p1f1', 'model': 'IPSL-CM6A-LR', 'clim_period': 'last_200Y'}]
Reference wref =  {'experiment': 'piControl', 'customname': 'piControl', 'ts_period': 'full', 'project': 'CMIP6', 'version': 'latest', 'frequency': 'monthly', 'realization': 'r1i1p1f1', 'model': 'IPSL-CM6A-LR', 'clim_period': 'last_200Y'}
dat_dict before .resolve  {'version': 'latest', 'customname': 'piControl', 'ts_period': 'full', 'project': 'CMIP6', 'experiment': 'piControl', 'frequency': 'monthly', 'realization': 'r1i1p1f1', 'variable': 'tas', 'model': 'IPSL-CM6A-LR', 'clim_period': 'last_200Y'}
Error in get_period_manager => No File found for  {'experiment': 'piControl', 'customname': 'piControl', 'ts_period': 'full', 'period': 'last_200Y', 'project': 'CMIP6', 'version': 'latest', 'frequency': 'monthly', 'realization': 'r1i1p1f1', 'variable': 'tas', 'model': 'IPSL-CM6A-LR', 'clim_period': 'last_200Y'}
custom_obs_dict =  {}
ref in plot_climato =  {'version': 'latest', 'customname': 'piControl', 'ts_period': 'full', 'project': 'CMIP6', 'experiment': 'piControl', 'frequency': 'monthly', 'realization': 'r1i1p1f1', 'variable': 'tas', 'model': 'IPSL-CM6A-LR', 'clim_period': 'last_200Y'}
model =  {'version': 'latest', 'customname': 'piControl', 'ts_period': 'full', 'project': 'CMIP6', 'experiment': 'piControl', 'frequency': 'monthly', 'realization': 'r1i1p1f1', 'variable': 'tas', 'model': 'IPSL-CM6A-LR', 'clim_period': 'last_200Y'}
Traceback (most recent call last):
  File "../../main_C-ESM-EP.py", line 248, in <module>
    execfile(diagnostics_file)
  File "/home/jypmce/C-ESM-EP/share/cesmep_diagnostics/diagnostics_Atmosphere_Surface.py", line 80, in <module>
    index += section_2D_maps(**kwargs)
  File "/home/jypmce/C-ESM-EP/share/cesmep_modules/CM_atlas/plot_CM_atlas.py", line 1093, in section_2D_maps
    wline_title += ' ; REF = ' + build_plot_title(ref, None)
  File "/home/jypmce/C-ESM-EP/share/cesmep_modules/CM_atlas/plot_CM_atlas.py", line 81, in build_plot_title
    ds_model = ds(**model)
  File "/ciclad-home/jservon/Evaluation/CliMAF/climaf_installs/climaf_1.2.12/climaf/classes.py", line 1488, in ds
    return cdataset(**select_projects(**kwargs))
  File "/ciclad-home/jservon/Evaluation/CliMAF/climaf_installs/climaf_1.2.12/climaf/classes.py", line 379, in __init__
    attval = processDatasetArgs(**kwargs)
  File "/ciclad-home/jservon/Evaluation/CliMAF/climaf_installs/climaf_1.2.12/climaf/classes.py", line 312, in processDatasetArgs
    attval['period'] = init_period(attval['period'])
  File "/ciclad-home/jservon/Evaluation/CliMAF/climaf_installs/climaf_1.2.12/climaf/period.py", line 201, in init_period
    "period start string %s is not a date (%s %s %s %s %s)" % (start, syear, smonth, sday, shour, sminute))
climaf.period.Climaf_Period_Error: 'period start string 0000 is not a date (0 1 1 0 0)'

Possible improvement:

I usually prepend some * (star) in front of my error message, and/or use ERROR. The result would be, in the case above:

dat_dict before .resolve  {'version': 'latest', 'customname': 'piControl', 'ts_period': 'full', 'project': 'CMIP6', 'experiment': 'piControl', 'frequency': 'monthly', 'realization': 'r1i1p1f1', 'variable': 'tas', 'model': 'IPSL-CM6A-LR', 'clim_period': 'last_200Y'}
  ** ERROR in get_period_manager => No File found for  {'experiment': 'piControl', 'customname': 'piControl', 'ts_period': 'full', 'period': 'last_200Y', 'project': 'CMIP6', 'version': 'latest', 'frequency': 'monthly', 'realization': 'r1i1p1f1', 'variable': 'tas', 'model': 'IPSL-CM6A-LR', 'clim_period': 'last_200Y'}
ref in plot_climato =  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant