From 2a675105cba096a9e65843b3a90af314f6778e4d Mon Sep 17 00:00:00 2001 From: haimkastner Date: Sun, 20 Oct 2024 10:19:28 +0000 Subject: [PATCH] Update to version 0.1.128 [skip-ci] Files changed: M setup.py M unitsnet_py/units/temperature_change_rate.py --- setup.py | 4 +- unitsnet_py/units/temperature_change_rate.py | 45 ++++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 7f3d1e4..877e199 100644 --- a/setup.py +++ b/setup.py @@ -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', diff --git a/unitsnet_py/units/temperature_change_rate.py b/unitsnet_py/units/temperature_change_rate.py index 12714e0..45e2178 100644 --- a/unitsnet_py/units/temperature_change_rate.py +++ b/unitsnet_py/units/temperature_change_rate.py @@ -20,6 +20,11 @@ class TemperatureChangeRateUnits(Enum): """ + DegreeKelvinPerMinute = 'DegreeKelvinPerMinute' + """ + + """ + NanodegreeCelsiusPerSecond = 'NanodegreeCelsiusPerSecond' """ @@ -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 @@ -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) @@ -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) @@ -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): """ @@ -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: """ @@ -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""" @@ -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"""