Skip to content

Commit

Permalink
Update to version 0.1.128 [skip-ci]
Browse files Browse the repository at this point in the history
Files changed:
M	setup.py
M	unitsnet_py/units/temperature_change_rate.py
  • Loading branch information
haimkastner committed Oct 20, 2024
1 parent 5de159a commit 2a67510
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

# The UnitNet definition version that the current package is based on to generate units classes
# see
definition_version = '5.59.0'
definition_version = '5.60.0'

setup_kwargs = {
'name': 'unitsnet-py',
'version': '0.1.127',
'version': '0.1.128',
'license': 'MIT',
'keywords': 'conversion, units-of-measure, units, quantities, unit-converter, converter, unit, measure, measures, measurement, measurements',
'description': 'A better way to hold unit variables and easily convert to the destination unit',
Expand Down
45 changes: 45 additions & 0 deletions unitsnet_py/units/temperature_change_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ class TemperatureChangeRateUnits(Enum):
"""

DegreeKelvinPerMinute = 'DegreeKelvinPerMinute'
"""
"""

NanodegreeCelsiusPerSecond = 'NanodegreeCelsiusPerSecond'
"""
Expand Down Expand Up @@ -130,6 +135,8 @@ def __init__(self, value: float, from_unit: TemperatureChangeRateUnits = Tempera

self.__degrees_celsius_per_minute = None

self.__degrees_kelvin_per_minute = None

self.__nanodegrees_celsius_per_second = None

self.__microdegrees_celsius_per_second = None
Expand Down Expand Up @@ -207,6 +214,9 @@ def __convert_from_base(self, from_unit: TemperatureChangeRateUnits) -> float:
if from_unit == TemperatureChangeRateUnits.DegreeCelsiusPerMinute:
return (value * 60)

if from_unit == TemperatureChangeRateUnits.DegreeKelvinPerMinute:
return ((value + 273.15) * 60)

if from_unit == TemperatureChangeRateUnits.NanodegreeCelsiusPerSecond:
return ((value) / 1e-09)

Expand Down Expand Up @@ -242,6 +252,9 @@ def __convert_to_base(self, value: float, to_unit: TemperatureChangeRateUnits) -
if to_unit == TemperatureChangeRateUnits.DegreeCelsiusPerMinute:
return (value / 60)

if to_unit == TemperatureChangeRateUnits.DegreeKelvinPerMinute:
return ((value / 60) - 273.15)

if to_unit == TemperatureChangeRateUnits.NanodegreeCelsiusPerSecond:
return ((value) * 1e-09)

Expand Down Expand Up @@ -304,6 +317,21 @@ def from_degrees_celsius_per_minute(degrees_celsius_per_minute: float):
return TemperatureChangeRate(degrees_celsius_per_minute, TemperatureChangeRateUnits.DegreeCelsiusPerMinute)


@staticmethod
def from_degrees_kelvin_per_minute(degrees_kelvin_per_minute: float):
"""
Create a new instance of TemperatureChangeRate from a value in degrees_kelvin_per_minute.
:param meters: The TemperatureChangeRate value in degrees_kelvin_per_minute.
:type degrees_kelvin_per_minute: float
:return: A new instance of TemperatureChangeRate.
:rtype: TemperatureChangeRate
"""
return TemperatureChangeRate(degrees_kelvin_per_minute, TemperatureChangeRateUnits.DegreeKelvinPerMinute)


@staticmethod
def from_nanodegrees_celsius_per_second(nanodegrees_celsius_per_second: float):
"""
Expand Down Expand Up @@ -446,6 +474,17 @@ def degrees_celsius_per_minute(self) -> float:
return self.__degrees_celsius_per_minute


@property
def degrees_kelvin_per_minute(self) -> float:
"""
"""
if self.__degrees_kelvin_per_minute != None:
return self.__degrees_kelvin_per_minute
self.__degrees_kelvin_per_minute = self.__convert_from_base(TemperatureChangeRateUnits.DegreeKelvinPerMinute)
return self.__degrees_kelvin_per_minute


@property
def nanodegrees_celsius_per_second(self) -> float:
"""
Expand Down Expand Up @@ -555,6 +594,9 @@ def to_string(self, unit: TemperatureChangeRateUnits = TemperatureChangeRateUnit
if unit == TemperatureChangeRateUnits.DegreeCelsiusPerMinute:
return f"""{super()._truncate_fraction_digits(self.degrees_celsius_per_minute, fractional_digits)} °C/min"""

if unit == TemperatureChangeRateUnits.DegreeKelvinPerMinute:
return f"""{super()._truncate_fraction_digits(self.degrees_kelvin_per_minute, fractional_digits)} K/min"""

if unit == TemperatureChangeRateUnits.NanodegreeCelsiusPerSecond:
return f"""{super()._truncate_fraction_digits(self.nanodegrees_celsius_per_second, fractional_digits)} n°C/s"""

Expand Down Expand Up @@ -595,6 +637,9 @@ def get_unit_abbreviation(self, unit_abbreviation: TemperatureChangeRateUnits =
if unit_abbreviation == TemperatureChangeRateUnits.DegreeCelsiusPerMinute:
return """°C/min"""

if unit_abbreviation == TemperatureChangeRateUnits.DegreeKelvinPerMinute:
return """K/min"""

if unit_abbreviation == TemperatureChangeRateUnits.NanodegreeCelsiusPerSecond:
return """n°C/s"""

Expand Down

0 comments on commit 2a67510

Please sign in to comment.