empty data causes a crash when trying to use a shared range
I got the following report from Mike Walters at NOAA. I still need to try to reproduce this locally.
First, I've noticed that when comparing variables with all fill/missing values, a fatal error can occur when this setting is used:
settings['useSharedRangeForOriginal'] = True
The error message looks like this:
Traceback (most recent call last): File "/data/data089/usr/compilers/python-2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "/data/data089/usr/compilers/python-2.7/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/data/data089/usr/compilers/python-2.7/lib/python2.7/site-packages/uwglance-0.3.3.2-py2.7.egg/glance/compare.py", line 1538, in sys.exit(main()) File "/data/data089/usr/compilers/python-2.7/lib/python2.7/site-packages/uwglance-0.3.3.2-py2.7.egg/glance/compare.py", line 1532, in main rc = lower_localsargs[0].lower() File "/data/data089/usr/compilers/python-2.7/lib/python2.7/site-packages/uwglance-0.3.3.2-py2.7.egg/glance/compare.py", line 1323, in reportGen return reportGen_library_call(a_path, b_path, args[2:], tempOptions) File "/data/data089/usr/compilers/python-2.7/lib/python2.7/site-packages/uwglance-0.3.3.2-py2.7.egg/glance/compare.py", line 923, in reportGen_library_call units_b= varRunInfo[VAR_UNITS_B_KEY] if VAR_UNITS_B_KEY in varRunInfo else None, File "/data/data089/usr/compilers/python-2.7/lib/python2.7/site-packages/uwglance-0.3.3.2-py2.7.egg/glance/plot.py", line 317, in plot_and_save_comparison_figures histRange=histRange File "/data/data089/usr/compilers/python-2.7/lib/python2.7/site-packages/uwglance-0.3.3.2-py2.7.egg/glance/plotcreatefns.py", line 1101, in create_plotting_functio ns shouldUseSharedRangeForOriginal) File "/data/data089/usr/compilers/python-2.7/lib/python2.7/site-packages/uwglance-0.3.3.2-py2.7.egg/glance/plotcreatefns.py", line 95, in _make_shared_range data_b=bData, valid_b_mask=goodInBMask) File "/data/data089/usr/compilers/python-2.7/lib/python2.7/site-packages/uwglance-0.3.3.2-py2.7.egg/glance/figures.py", line 81, in _make_range minVal -= offset_to_range TypeError: unsupported operand type(s) for -=: 'NoneType' and 'float'
I've been setting 'useSharedRangeForOriginal' to False to work around the problem, but that can sometimes make the resulting plots harder to read.