Skip to content

Commit

Permalink
fix(datatype): Add ft/min as a unit for Speed
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Feb 16, 2024
1 parent 18e82e4 commit 333c799
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ladybug/datatype/speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
class Speed(DataTypeBase):
"""Speed
"""
_units = ('m/s', 'mph', 'km/h', 'knot', 'ft/s')
_units = ('m/s', 'mph', 'km/h', 'knot', 'ft/s', 'ft/min')
_si_units = ('m/s', 'km/h')
_ip_units = ('mph', 'ft/s')
_ip_units = ('mph', 'ft/s', 'ft/min')
_min = 0
_abbreviation = 'v'
_time_aggregated_type = Distance
Expand All @@ -29,6 +29,9 @@ def _m_s_to_knot(self, value):
def _m_s_to_ft_s(self, value):
return value * 3.28084

def _m_s_to_ft_min(self, value):
return value * 196.85

def _mph_to_m_s(self, value):
return value / 2.23694

Expand All @@ -41,6 +44,9 @@ def _knot_to_m_s(self, value):
def _ft_s_to_m_s(self, value):
return value / 3.28084

def _ft_min_to_m_s(self, value):
return value / 196.85

def to_unit(self, values, unit, from_unit):
"""Return values converted to the unit given the input from_unit."""
return self._to_unit_base('m/s', values, unit, from_unit)
Expand Down

0 comments on commit 333c799

Please sign in to comment.