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

Using the -a flag can cause an unhandled exception #143

Open
sterlingbaldwin opened this issue Mar 11, 2019 · 1 comment
Open

Using the -a flag can cause an unhandled exception #143

sterlingbaldwin opened this issue Mar 11, 2019 · 1 comment

Comments

@sterlingbaldwin
Copy link

INFO       2019-03-11 15:10:07,152 Scanning /p/user_pub/work/E3SM/1_0/historical/1deg_atm_60-30km_ocean/ocean/native/model-output/mon/ens1/v1/mpaso.hist.am.timeSeriesStatsMonthly.1850-01-01.nc
INFO       2019-03-11 15:10:07,172 Aggregate dimension not found: Time
Traceback (most recent call last):
  File "/usr/local/conda/envs/esgf-pub/bin/esgpublish", line 782, in <module>
    main(sys.argv[1:])
  File "/usr/local/conda/envs/esgf-pub/bin/esgpublish", line 754, in main
    commitEvery=commitEvery, validate_standard_name=validate_standard_name)
  File "/usr/local/conda/envs/esgf-pub/lib/python2.7/site-packages/esgcet/publish/utility.py", line 857, in iterateOverDatasets
    pid_connector=pid_connector, test_publication=test_publication, commitEvery=commitEvery, **context)
  File "/usr/local/conda/envs/esgf-pub/lib/python2.7/site-packages/esgcet/publish/extract.py", line 200, in extractFromDataset
    addNewVersion, fobjs = createDataset(dset, pathlist, session, handler, cfHandler, configOptions, aggregateDimensionName=aggregateDimensionName, offline=offline, progressCallback=progressCallback, stopEvent=stopEvent, extraFields=extraFields, masterGateway=masterGateway, useVersion=useVersion, commitEvery=commitEvery, **context)
  File "/usr/local/conda/envs/esgf-pub/lib/python2.7/site-packages/esgcet/publish/extract.py", line 368, in createDataset
    extractFromFile(dset, f, file, session, handler, cfHandler, aggdimName=aggregateDimensionName, varlocate=varlocate, exclude_variables=exclude_variables, perVariable=perVariable, **context)
  File "/usr/local/conda/envs/esgf-pub/lib/python2.7/site-packages/esgcet/publish/extract.py", line 780, in extractFromFile
    filevar.aggdim_first = float(aggvarFirst)
UnboundLocalError: local variable 'aggvarFirst' referenced before assignment

The aggvarFirst variable is set inside an if block, if that block is skipped because its condition if false, the variable may be referenced later causing an referenced before assignment error.

@sterlingbaldwin
Copy link
Author

The secondary issue here is that there is in fact a dimension named Time, and esgpublish isnt able to find it.

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