Skip to content

Commit

Permalink
add test tait
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoMVale committed Oct 8, 2023
1 parent 69fbe60 commit 76d4458
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# PolyKin: A polymerization kinetics library for Python.
#
# Copyright Hugo Vale 2023
11 changes: 11 additions & 0 deletions tests/physprops/test_tait.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from polykin.physprops.tait import Tait
from polykin.utils import RangeError
from polykin.physprops.tait import load_Tait_parameters


import pytest
Expand Down Expand Up @@ -92,3 +93,13 @@ def test_alpha(tait_instance):
def test_beta(tait_instance):
beta = tait_instance.beta(432.15, 2e8)
assert np.isclose(beta, 2.7765e-10, atol=atol, rtol=rtol)


def test_all_polymers_database():
table = load_Tait_parameters()
polymers = table.index.to_list()
for polymer in polymers:
m = Tait.from_database(polymer)
assert m is not None
rhoP = 1/m.eval(298., 1e5)
assert (rhoP > 750. and rhoP < 2200.)

0 comments on commit 76d4458

Please sign in to comment.