diff --git a/pyproject.toml b/pyproject.toml index 6cbd405..21a759c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "unitsnet_py" -version = "0.1.64" +version = "0.1.65" description = "A better way to hold unit variables and easily convert to the destination unit" repository = "https://github.com/haimkastner/unitsnet-py" authors = ["Haim Kastner "] diff --git a/setup.py b/setup.py index ec7bb95..66ee6e9 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup_kwargs = { 'name': 'unitsnet-py', - 'version': '0.1.64', + 'version': '0.1.65', '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', 'long_description': long_description, diff --git a/unitsnet_py/units/density.py b/unitsnet_py/units/density.py index 1972bfc..fd862cf 100644 --- a/unitsnet_py/units/density.py +++ b/unitsnet_py/units/density.py @@ -175,6 +175,11 @@ class DensityUnits(Enum): """ + FemtogramPerLiter = 'femtogram_per_liter' + """ + + """ + PicogramPerLiter = 'picogram_per_liter' """ @@ -205,6 +210,11 @@ class DensityUnits(Enum): """ + FemtogramPerDeciliter = 'femtogram_per_deciliter' + """ + + """ + PicogramPerDeciliter = 'picogram_per_deciliter' """ @@ -235,6 +245,11 @@ class DensityUnits(Enum): """ + FemtogramPerMilliliter = 'femtogram_per_milliliter' + """ + + """ + PicogramPerMilliliter = 'picogram_per_milliliter' """ @@ -347,6 +362,8 @@ def __init__(self, value: float, from_unit: DensityUnits = DensityUnits.Kilogram self.__kilopounds_per_cubic_foot = None + self.__femtograms_per_liter = None + self.__picograms_per_liter = None self.__nanograms_per_liter = None @@ -359,6 +376,8 @@ def __init__(self, value: float, from_unit: DensityUnits = DensityUnits.Kilogram self.__decigrams_per_liter = None + self.__femtograms_per_deci_liter = None + self.__picograms_per_deci_liter = None self.__nanograms_per_deci_liter = None @@ -371,6 +390,8 @@ def __init__(self, value: float, from_unit: DensityUnits = DensityUnits.Kilogram self.__decigrams_per_deci_liter = None + self.__femtograms_per_milliliter = None + self.__picograms_per_milliliter = None self.__nanograms_per_milliliter = None @@ -489,6 +510,9 @@ def __convert_from_base(self, from_unit: DensityUnits) -> float: if from_unit == DensityUnits.KilopoundPerCubicFoot: return ((value * 0.062427961) / 1000.0) + if from_unit == DensityUnits.FemtogramPerLiter: + return ((value * 1) / 1e-15) + if from_unit == DensityUnits.PicogramPerLiter: return ((value * 1) / 1e-12) @@ -507,6 +531,9 @@ def __convert_from_base(self, from_unit: DensityUnits) -> float: if from_unit == DensityUnits.DecigramPerLiter: return ((value * 1) / 0.1) + if from_unit == DensityUnits.FemtogramPerDeciliter: + return ((value * 1e-1) / 1e-15) + if from_unit == DensityUnits.PicogramPerDeciliter: return ((value * 1e-1) / 1e-12) @@ -525,6 +552,9 @@ def __convert_from_base(self, from_unit: DensityUnits) -> float: if from_unit == DensityUnits.DecigramPerDeciliter: return ((value * 1e-1) / 0.1) + if from_unit == DensityUnits.FemtogramPerMilliliter: + return ((value * 1e-3) / 1e-15) + if from_unit == DensityUnits.PicogramPerMilliliter: return ((value * 1e-3) / 1e-12) @@ -647,6 +677,9 @@ def __convert_to_base(self, value: float, to_unit: DensityUnits) -> float: if to_unit == DensityUnits.KilopoundPerCubicFoot: return ((value / 0.062427961) * 1000.0) + if to_unit == DensityUnits.FemtogramPerLiter: + return ((value / 1) * 1e-15) + if to_unit == DensityUnits.PicogramPerLiter: return ((value / 1) * 1e-12) @@ -665,6 +698,9 @@ def __convert_to_base(self, value: float, to_unit: DensityUnits) -> float: if to_unit == DensityUnits.DecigramPerLiter: return ((value / 1) * 0.1) + if to_unit == DensityUnits.FemtogramPerDeciliter: + return ((value / 1e-1) * 1e-15) + if to_unit == DensityUnits.PicogramPerDeciliter: return ((value / 1e-1) * 1e-12) @@ -683,6 +719,9 @@ def __convert_to_base(self, value: float, to_unit: DensityUnits) -> float: if to_unit == DensityUnits.DecigramPerDeciliter: return ((value / 1e-1) * 0.1) + if to_unit == DensityUnits.FemtogramPerMilliliter: + return ((value / 1e-3) * 1e-15) + if to_unit == DensityUnits.PicogramPerMilliliter: return ((value / 1e-3) * 1e-12) @@ -1204,6 +1243,21 @@ def from_kilopounds_per_cubic_foot(kilopounds_per_cubic_foot: float): return Density(kilopounds_per_cubic_foot, DensityUnits.KilopoundPerCubicFoot) + @staticmethod + def from_femtograms_per_liter(femtograms_per_liter: float): + """ + Create a new instance of Density from a value in femtograms_per_liter. + + + + :param meters: The Density value in femtograms_per_liter. + :type femtograms_per_liter: float + :return: A new instance of Density. + :rtype: Density + """ + return Density(femtograms_per_liter, DensityUnits.FemtogramPerLiter) + + @staticmethod def from_picograms_per_liter(picograms_per_liter: float): """ @@ -1294,6 +1348,21 @@ def from_decigrams_per_liter(decigrams_per_liter: float): return Density(decigrams_per_liter, DensityUnits.DecigramPerLiter) + @staticmethod + def from_femtograms_per_deci_liter(femtograms_per_deci_liter: float): + """ + Create a new instance of Density from a value in femtograms_per_deci_liter. + + + + :param meters: The Density value in femtograms_per_deci_liter. + :type femtograms_per_deci_liter: float + :return: A new instance of Density. + :rtype: Density + """ + return Density(femtograms_per_deci_liter, DensityUnits.FemtogramPerDeciliter) + + @staticmethod def from_picograms_per_deci_liter(picograms_per_deci_liter: float): """ @@ -1384,6 +1453,21 @@ def from_decigrams_per_deci_liter(decigrams_per_deci_liter: float): return Density(decigrams_per_deci_liter, DensityUnits.DecigramPerDeciliter) + @staticmethod + def from_femtograms_per_milliliter(femtograms_per_milliliter: float): + """ + Create a new instance of Density from a value in femtograms_per_milliliter. + + + + :param meters: The Density value in femtograms_per_milliliter. + :type femtograms_per_milliliter: float + :return: A new instance of Density. + :rtype: Density + """ + return Density(femtograms_per_milliliter, DensityUnits.FemtogramPerMilliliter) + + @staticmethod def from_picograms_per_milliliter(picograms_per_milliliter: float): """ @@ -1837,6 +1921,17 @@ def kilopounds_per_cubic_foot(self) -> float: return self.__kilopounds_per_cubic_foot + @property + def femtograms_per_liter(self) -> float: + """ + + """ + if self.__femtograms_per_liter != None: + return self.__femtograms_per_liter + self.__femtograms_per_liter = self.__convert_from_base(DensityUnits.FemtogramPerLiter) + return self.__femtograms_per_liter + + @property def picograms_per_liter(self) -> float: """ @@ -1903,6 +1998,17 @@ def decigrams_per_liter(self) -> float: return self.__decigrams_per_liter + @property + def femtograms_per_deci_liter(self) -> float: + """ + + """ + if self.__femtograms_per_deci_liter != None: + return self.__femtograms_per_deci_liter + self.__femtograms_per_deci_liter = self.__convert_from_base(DensityUnits.FemtogramPerDeciliter) + return self.__femtograms_per_deci_liter + + @property def picograms_per_deci_liter(self) -> float: """ @@ -1969,6 +2075,17 @@ def decigrams_per_deci_liter(self) -> float: return self.__decigrams_per_deci_liter + @property + def femtograms_per_milliliter(self) -> float: + """ + + """ + if self.__femtograms_per_milliliter != None: + return self.__femtograms_per_milliliter + self.__femtograms_per_milliliter = self.__convert_from_base(DensityUnits.FemtogramPerMilliliter) + return self.__femtograms_per_milliliter + + @property def picograms_per_milliliter(self) -> float: """ @@ -2141,6 +2258,9 @@ def to_string(self, unit: DensityUnits = DensityUnits.KilogramPerCubicMeter) -> if unit == DensityUnits.KilopoundPerCubicFoot: return f"""{self.kilopounds_per_cubic_foot} klb/ft³""" + if unit == DensityUnits.FemtogramPerLiter: + return f"""{self.femtograms_per_liter} fg/L""" + if unit == DensityUnits.PicogramPerLiter: return f"""{self.picograms_per_liter} pg/L""" @@ -2159,6 +2279,9 @@ def to_string(self, unit: DensityUnits = DensityUnits.KilogramPerCubicMeter) -> if unit == DensityUnits.DecigramPerLiter: return f"""{self.decigrams_per_liter} dg/L""" + if unit == DensityUnits.FemtogramPerDeciliter: + return f"""{self.femtograms_per_deci_liter} fg/dl""" + if unit == DensityUnits.PicogramPerDeciliter: return f"""{self.picograms_per_deci_liter} pg/dl""" @@ -2177,6 +2300,9 @@ def to_string(self, unit: DensityUnits = DensityUnits.KilogramPerCubicMeter) -> if unit == DensityUnits.DecigramPerDeciliter: return f"""{self.decigrams_per_deci_liter} dg/dl""" + if unit == DensityUnits.FemtogramPerMilliliter: + return f"""{self.femtograms_per_milliliter} fg/ml""" + if unit == DensityUnits.PicogramPerMilliliter: return f"""{self.picograms_per_milliliter} pg/ml""" @@ -2304,6 +2430,9 @@ def get_unit_abbreviation(self, unit_abbreviation: DensityUnits = DensityUnits.K if unit_abbreviation == DensityUnits.KilopoundPerCubicFoot: return """klb/ft³""" + if unit_abbreviation == DensityUnits.FemtogramPerLiter: + return """fg/L""" + if unit_abbreviation == DensityUnits.PicogramPerLiter: return """pg/L""" @@ -2322,6 +2451,9 @@ def get_unit_abbreviation(self, unit_abbreviation: DensityUnits = DensityUnits.K if unit_abbreviation == DensityUnits.DecigramPerLiter: return """dg/L""" + if unit_abbreviation == DensityUnits.FemtogramPerDeciliter: + return """fg/dl""" + if unit_abbreviation == DensityUnits.PicogramPerDeciliter: return """pg/dl""" @@ -2340,6 +2472,9 @@ def get_unit_abbreviation(self, unit_abbreviation: DensityUnits = DensityUnits.K if unit_abbreviation == DensityUnits.DecigramPerDeciliter: return """dg/dl""" + if unit_abbreviation == DensityUnits.FemtogramPerMilliliter: + return """fg/ml""" + if unit_abbreviation == DensityUnits.PicogramPerMilliliter: return """pg/ml"""