UnitValues 0.1.5__tar.gz → 0.1.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: UnitValues
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: A small package for using units in Python. Allows for computation with dimensioned qauntities and allows you to convert between different units. Do anything you would do with regular floats or integers in Python except now with units. Package is compatible with NumPy, SciPy + Pandas are in the works. I think you'll find this implementation more elegant then most other unit packages.
5
5
  Author-email: Brody Howard <brody.howard@mail.utoronto.ca>
6
6
  Project-URL: Homepage, https://github.com/BroRocket/unitvalue/
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "UnitValues"
3
- version = "0.1.5"
3
+ version = "0.1.6"
4
4
  dependencies = [
5
5
  "numpy >= 1.23.2"
6
6
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: UnitValues
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: A small package for using units in Python. Allows for computation with dimensioned qauntities and allows you to convert between different units. Do anything you would do with regular floats or integers in Python except now with units. Package is compatible with NumPy, SciPy + Pandas are in the works. I think you'll find this implementation more elegant then most other unit packages.
5
5
  Author-email: Brody Howard <brody.howard@mail.utoronto.ca>
6
6
  Project-URL: Homepage, https://github.com/BroRocket/unitvalue/
@@ -612,7 +612,7 @@ class UnitValue:
612
612
  if self.__unit != a.__unit:
613
613
  raise TypeError(f"Cannot add unit {self.__unit} and unit {a.__unit}")
614
614
  return UnitValue(self.__system, self.__dimension, self.__unit, self.value + a.value)
615
- if self.__dimension == "TEMPERATURE" and self.__unit != "K" or a.__unit != "K":
615
+ if self.__dimension == "TEMPERATURE" and (self.__unit != "K" or a.__unit != "K"):
616
616
  self.convert_base_metric()
617
617
  a.convert_base_metric()
618
618
  return UnitValue(self.__system, self.__dimension, self.__unit, self.value + a.value - 273.15)
@@ -640,7 +640,7 @@ class UnitValue:
640
640
  if self.__unit != s.__unit:
641
641
  raise TypeError(f"Cannot subtract unit {self.__unit} and unit {s.__unit}")
642
642
  return UnitValue(self.__system, self.__dimension, self.__unit, self.value - s.value)
643
- if self.__dimension == "TEMPERATURE" and self.__unit != "K" or s.__unit != "K":
643
+ if self.__dimension == "TEMPERATURE" and (self.__unit != "K" or s.__unit != "K"):
644
644
  self.convert_base_metric()
645
645
  s.convert_base_metric()
646
646
  return UnitValue(self.__system, self.__dimension, self.__unit, self.value - s.value + 273.15)
@@ -993,4 +993,10 @@ class UnitValue:
993
993
  def system(self) -> str:
994
994
  return self.__system
995
995
 
996
+ if __name__ == "__main__":
997
+ m1 = UnitValue.create_unit("kg/s", 0.4)
998
+ m2 = UnitValue.create_unit("kg/s", 0.15)
999
+ m3 = m1 - m2
1000
+ print(m3)
1001
+
996
1002
 
File without changes
File without changes
File without changes