Skip to content

Commit

Permalink
Update to version 0.1.65 [skip-ci]
Browse files Browse the repository at this point in the history
Files changed:
M	pyproject.toml
M	setup.py
M	unitsnet_py/units/density.py
  • Loading branch information
haimkastner committed Oct 4, 2023
1 parent c02079e commit 7903c19
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
135 changes: 135 additions & 0 deletions unitsnet_py/units/density.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ class DensityUnits(Enum):
"""

FemtogramPerLiter = 'femtogram_per_liter'
"""
"""

PicogramPerLiter = 'picogram_per_liter'
"""
Expand Down Expand Up @@ -205,6 +210,11 @@ class DensityUnits(Enum):
"""

FemtogramPerDeciliter = 'femtogram_per_deciliter'
"""
"""

PicogramPerDeciliter = 'picogram_per_deciliter'
"""
Expand Down Expand Up @@ -235,6 +245,11 @@ class DensityUnits(Enum):
"""

FemtogramPerMilliliter = 'femtogram_per_milliliter'
"""
"""

PicogramPerMilliliter = 'picogram_per_milliliter'
"""
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand Down Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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:
"""
Expand Down Expand Up @@ -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:
"""
Expand Down Expand Up @@ -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:
"""
Expand Down Expand Up @@ -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"""

Expand All @@ -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"""

Expand All @@ -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"""

Expand Down Expand Up @@ -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"""

Expand All @@ -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"""

Expand All @@ -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"""

Expand Down

0 comments on commit 7903c19

Please sign in to comment.