Commit 437db74 introduced a bug in FGmaxGrid.read_output: If point_style is not one of 2, 3, or 4, the variable reshape_order is not set.
|
if point_style in [2,3,4]: |
|
|
|
if indexing == 'xy': |
|
reshape_order = 'C' |
|
elif indexing == 'ij': |
|
reshape_order = 'F' |
|
else: |
|
raise InputError("*** indexing must by 'xy' or 'ij'") |
|
|
|
self.indexing = indexing # make available to user |
This leads to an error later, where reshape_order is always used, irrespective of the point_style:
|
X = numpy.reshape(d[:,0],fg_shape,order=reshape_order) |
|
Y = numpy.reshape(d[:,1],fg_shape,order=reshape_order) |
|
y0 = 0.5*(Y.min() + Y.max()) # mid-latitude for scaling plots |
|
h = numpy.reshape(d[:,ind_h],fg_shape,order=reshape_order) |
|
|
|
# AMR level used for each fgmax value: |
|
level = numpy.reshape(d[:,ind_level].astype('int'),fg_shape, |
|
order=reshape_order) |
> X = numpy.reshape(d[:,0],fg_shape,order=reshape_order)
^^^^^^^^^^^^^
E UnboundLocalError: cannot access local variable 'reshape_order' where it is not associated with a value
There should be a default value set for reshape_order to avoid this issue.
Commit 437db74 introduced a bug in
FGmaxGrid.read_output: Ifpoint_styleis not one of 2, 3, or 4, the variablereshape_orderis not set.geoclaw/src/python/geoclaw/fgmax_tools.py
Lines 384 to 393 in 11479f6
This leads to an error later, where
reshape_orderis always used, irrespective of thepoint_style:geoclaw/src/python/geoclaw/fgmax_tools.py
Lines 479 to 486 in 11479f6
There should be a default value set for
reshape_orderto avoid this issue.