Skip to content

Commit

Permalink
Update to version 0.1.70 [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 Dec 6, 2023
1 parent 00d25be commit 43ad261
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 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.69"
version = "0.1.70"
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.69',
'version': '0.1.70',
'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
14 changes: 7 additions & 7 deletions unitsnet_py/units/density.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class DensityUnits(Enum):

PoundPerCubicYard = 'pound_per_cubic_yard'
"""
Calculated from the definition of <a href="https://en.wikipedia.org/wiki/Pound_(mass)">pound</a> and <a href="https://en.wikipedia.org/wiki/Yard">yard</a> compared to metric kilogram and meter.
"""

TonnePerCubicMillimeter = 'tonne_per_cubic_millimeter'
Expand Down Expand Up @@ -441,7 +441,7 @@ def __convert_from_base(self, from_unit: DensityUnits) -> float:
return (value * 0.062427961)

if from_unit == DensityUnits.PoundPerCubicYard:
return (value * 1.685554936)
return (value * (0.45359237 / 0.9144 / 0.9144 / 0.9144))

if from_unit == DensityUnits.TonnePerCubicMillimeter:
return (value * 1e-12)
Expand Down Expand Up @@ -528,7 +528,7 @@ def __convert_from_base(self, from_unit: DensityUnits) -> float:
return ((value * 0.062427961) / 1000.0)

if from_unit == DensityUnits.KilopoundPerCubicYard:
return ((value * 1.685554936) / 1000.0)
return ((value * (0.45359237 / 0.9144 / 0.9144 / 0.9144)) / 1000.0)

if from_unit == DensityUnits.FemtogramPerLiter:
return ((value * 1) / 1e-15)
Expand Down Expand Up @@ -614,7 +614,7 @@ def __convert_to_base(self, value: float, to_unit: DensityUnits) -> float:
return (value / 0.062427961)

if to_unit == DensityUnits.PoundPerCubicYard:
return (value / 1.685554936)
return (value / (0.45359237 / 0.9144 / 0.9144 / 0.9144))

if to_unit == DensityUnits.TonnePerCubicMillimeter:
return (value / 1e-12)
Expand Down Expand Up @@ -701,7 +701,7 @@ def __convert_to_base(self, value: float, to_unit: DensityUnits) -> float:
return ((value / 0.062427961) * 1000.0)

if to_unit == DensityUnits.KilopoundPerCubicYard:
return ((value / 1.685554936) * 1000.0)
return ((value / (0.45359237 / 0.9144 / 0.9144 / 0.9144)) * 1000.0)

if to_unit == DensityUnits.FemtogramPerLiter:
return ((value / 1) * 1e-15)
Expand Down Expand Up @@ -854,7 +854,7 @@ def from_pounds_per_cubic_yard(pounds_per_cubic_yard: float):
"""
Create a new instance of Density from a value in pounds_per_cubic_yard.
Calculated from the definition of <a href="https://en.wikipedia.org/wiki/Pound_(mass)">pound</a> and <a href="https://en.wikipedia.org/wiki/Yard">yard</a> compared to metric kilogram and meter.
:param meters: The Density value in pounds_per_cubic_yard.
:type pounds_per_cubic_yard: float
Expand Down Expand Up @@ -1672,7 +1672,7 @@ def pounds_per_cubic_foot(self) -> float:
@property
def pounds_per_cubic_yard(self) -> float:
"""
Calculated from the definition of <a href="https://en.wikipedia.org/wiki/Pound_(mass)">pound</a> and <a href="https://en.wikipedia.org/wiki/Yard">yard</a> compared to metric kilogram and meter.
"""
if self.__pounds_per_cubic_yard != None:
return self.__pounds_per_cubic_yard
Expand Down

0 comments on commit 43ad261

Please sign in to comment.