From 76d4458d96fd6052c8d7c3546f7a1fc08e43d99b Mon Sep 17 00:00:00 2001 From: HugoMVale <57530119+HugoMVale@users.noreply.github.com> Date: Sun, 8 Oct 2023 20:34:29 +0200 Subject: [PATCH] add test tait --- tests/__init__.py | 3 +++ tests/physprops/test_tait.py | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..6f37291 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,3 @@ +# PolyKin: A polymerization kinetics library for Python. +# +# Copyright Hugo Vale 2023 diff --git a/tests/physprops/test_tait.py b/tests/physprops/test_tait.py index 62dfb6c..14b6d6d 100644 --- a/tests/physprops/test_tait.py +++ b/tests/physprops/test_tait.py @@ -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 @@ -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.)