Skip to content

Commit

Permalink
testing for Joback 1
Browse files Browse the repository at this point in the history
  • Loading branch information
SalvadorBrandolin committed Nov 3, 2023
1 parent b61c53e commit 6846af7
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ testpaths = [
markers = [
"UNIFAC: classic UNIFAC model tests",
"PSRK: predictive SRK model tests",
"Joback: Joback-Reid contribution model"
]

[project]
Expand Down
22 changes: 22 additions & 0 deletions tests/joback/test_no_ring_hydrocarbons.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pytest

import ugropy as ug


# =============================================================================
# -CH3, -CH2-, >CH-, >C<, CH2=CH-, -CH=CH-, =C<, =C=, CH, C
# =============================================================================
# Joback
trials_unifac = [
("CCC(CC)C(C)(C)C", {"-CH3": 5, "-CH2-": 2, ">CH-": 1, ">C<": 1}, "smiles"),
("CC", {"-CH3": 2}, "smiles"), # ethane
("CCCCCC", {"-CH3": 2, "-CH2-": 4}, "smiles"), # hexane
("CC(C)C", {"-CH3": 3, ">CH-": 1}, "smiles"), # 2-methylpropane
("CC(C)(C)C", {"-CH3": 4, ">C<": 1}, "smiles"), # 2,2-dimethylpropane
]


@pytest.mark.Joback
@pytest.mark.parametrize("identifier, result, identifier_type", trials_unifac)
def test_joback_no_cyclic_hydrocarbon(identifier, result, identifier_type):
assert ug.get_joback_groups(identifier, identifier_type) == result
34 changes: 34 additions & 0 deletions tests/joback/test_ring_hydrocarbons.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import pytest

import ugropy as ug


# =============================================================================
#
# =============================================================================
# Joback
trials_unifac = [
# ("C1CC2CCCC3CCCC1C23", {"CH2": 8, "CH": 4}, "smiles"),
# ("C1C2CCCCC2C2CCCCC12", {"CH2": 9, "CH": 4}, "smiles"),
# ("C1C2CC1CCCC2", {"CH2": 6, "CH": 2}, "smiles"),
# ("C1CCCCCCCC1", {"CH2": 9}, "smiles"),
# ("C1CCCCCCCC1", {"CH2": 9}, "smiles"),
# ("C1C2CC3CC1CC(C2)C3", {"CH2": 6, "CH": 4}, "smiles"),
# ("C12C3C1C1C2C31", {"CH": 6}, "smiles"),
# ("C1CC2CC1CCC2", {"CH2": 6, "CH": 2}, "smiles"),
# ("C1CC2CC3CCC2CC13", {"CH2": 6, "CH": 4}, "smiles"),
# ("C12C3C4C1C1C2C3C41", {"CH": 8}, "smiles"),
# ("C1CC1", {"CH2": 3}, "smiles"),
# ("C1CCC1", {"CH2": 4}, "smiles"),
# ("C1C2CC1CCCC2", {"CH2": 6, "CH": 2}, "smiles"),
# ("CC12C3CCC4CCC1C234", {"CH3": 1, "CH2": 4, "CH": 3, "C": 2}, "smiles"),
# ("C1CCC2CCCCC2C1", {"CH2": 8, "CH": 2}, "smiles"),
# ("C1CCC(CC1)CC2CCCCC2", {"CH2": 11, "CH": 2}, "smiles"),
# ("C1CCCCC1", {"CH2": 6}, "smiles"), # cyclohexane
]


@pytest.mark.Joback
@pytest.mark.parametrize("identifier, result, identifier_type", trials_unifac)
def test_joback_cyclic_hydrocarbon(identifier, result, identifier_type):
assert ug.get_joback_groups(identifier, identifier_type) == result

0 comments on commit 6846af7

Please sign in to comment.