Skip to content

Commit

Permalink
Reduce return statements in lfc
Browse files Browse the repository at this point in the history
  • Loading branch information
zbruick committed Sep 19, 2019
1 parent b6e82b2 commit 44b60c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions metpy/calc/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,10 @@ def lfc(pressure, temperature, dewpt, parcel_temperature_profile=None, dewpt_sta
mask = pressure < this_lcl[0]
if np.all(_less_or_close(parcel_temperature_profile[mask], temperature[mask])):
# LFC doesn't exist
return np.nan * pressure.units, np.nan * temperature.units
x, y = np.nan * pressure.units, np.nan * temperature.units
else: # LFC = LCL
x, y = this_lcl
return x, y
return x, y

# LFC exists. Make sure it is no lower than the LCL
else:
Expand All @@ -449,10 +449,10 @@ def lfc(pressure, temperature, dewpt, parcel_temperature_profile=None, dewpt_sta
temperature[1:], direction='decreasing',
log_x=True)
if el_pres > this_lcl[0]:
return np.nan * pressure.units, np.nan * temperature.units
x, y = np.nan * pressure.units, np.nan * temperature.units
else:
x, y = this_lcl
return x, y
return x, y
# Otherwise, find all LFCs that exist above the LCL
# What is returned depends on which flag as described in the docstring
else:
Expand Down

0 comments on commit 44b60c0

Please sign in to comment.