Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(datatype): Add ft/min as a unit for Speed #610

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading