Skip to content

Commit

Permalink
fixing composition issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Membrizard committed Dec 2, 2022
1 parent 9b4d0d0 commit 8d3f75b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyvaporation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@
"Components",
]

__version__ = "1.1.6"
__version__ = "1.1.7"
4 changes: 2 additions & 2 deletions pyvaporation/mixtures/mixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class Composition:

def __attrs_post_init__(self):
if self.p < 0:
self.p = 0
self.p = 1e-10
if self.p > 1:
self.p = 1
self.p = 1-1e-10

@property
def first(self) -> float:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name="pyvaporation",
packages=find_packages(),
version="1.1.6",
version="1.1.7",
license="Apache license 2.0",
description="Set of tools for modelling pervaporation processes",
author="Denis Sapegin, Aleksei Chekmachev",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_mixtures/test_mixture_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,5 @@ def test_get_nrtl_partial_pressures_from_weight_composition():


def test_invalid_compositions():
assert Composition(p=-1, type="weight") == Composition(p=0, type="weight")
assert Composition(p=2, type="weight") == Composition(p=1, type="weight")
assert Composition(p=-1, type="weight") == Composition(p=1e-10, type="weight")
assert Composition(p=2, type="weight") == Composition(p=(1-1e-10), type="weight")

0 comments on commit 8d3f75b

Please sign in to comment.