Skip to content

Commit

Permalink
MNT: Fix unit multiplication lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dopplershift committed Dec 3, 2021
1 parent b27df0d commit 2fffd34
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/metpy/plots/skewt.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,14 @@ def _get_line_starting_temps(self, t0=None, spacing=10):
if t0 is None:
# minimum and maximum temperature
xmin, xmax = self.ax.get_xlim()
t0 = np.arange(xmin, xmax + 1, spacing) * self.ax.xaxis.units
t0 = units.Quantity(np.arange(xmin, xmax + 1, spacing), self.ax.xaxis.units)

# if temperature has no units, guess from the lower bound
if not hasattr(t0, 'units'):
if np.nanmin(t0) > 150:
t0 = t0 * units.degK
t0 = units.Quantity(t0, 'K')
else:
t0 = t0 * units.degC
t0 = units.Quantity(t0, 'degC')

# return temperature in units matching axes
return t0.to(self.ax.xaxis.units)
Expand Down

0 comments on commit 2fffd34

Please sign in to comment.