Skip to content

Commit

Permalink
all test fixed. Also CHO aldehyde groups was replaced with HCO and CH…
Browse files Browse the repository at this point in the history
…-O ether group replaced with CHO for consistency
  • Loading branch information
SalvadorBrandolin committed Nov 3, 2023
1 parent b93489b commit b61c53e
Show file tree
Hide file tree
Showing 43 changed files with 257 additions and 392 deletions.
59 changes: 1 addition & 58 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,63 +14,6 @@ testpaths = [
markers = [
"UNIFAC: classic UNIFAC model tests",
"PSRK: predictive SRK model tests",
"CH2: CH3, CH2, CH, C",
"CeqC: CH2=CH, CH=CH, CH2=C, CH=C, C=C",
"ACH: ACH, AC",
"ACCH2: ACCH3, ACCH2, ACCH",
"OH: OH, CH3OH",
"CH3OH: CH3OH",
"H2O: H2O",
"ACOH: ACOH",
"CH2CO: CH3CO, CH2CO",
"CHO: CHO",
"CCOO: CH3COO, CH2COO",
"HCOO: HCOO",
"CH2O: CH3O, CH2O, CH-O, THF",
"CH3NH2: CH3NH2, CH2NH2, CHNH2",
"CNH: CH3NH, CH2NH, CHNH",
"C3N: CH3N, CH2N",
"ACNH2: ACNH2",
"pyridine: C5H5N, C5H4N, C5H3N",
"CCN: CH3CN, CH2CN",
"COOH: COOH, HCOOH",
"CCL: CH2CL, CHCL, CCL",
"CCL2: CH2CL2, CHCL2, CCL2",
"CCL3: CHCL3, CCL3",
"CCL4: CCL4",
"ACCL: ACCL",
"CNO2: CH3NO2, CH2NO2, CHNO2",
"ACNO2: ACNO2",
"CS2: CS2",
"CH3SH: CH3SH, CH2SH",
"FURFURAL: FURFURAL",
"DOH: DOH",
"I: I",
"BR: Br",
"alquine: CH=-C",
"DMSO: DMSO",
"ACRY: ACRY",
"CLCeqC: CL-(C=C)",
"ACF: ACF",
"DMF: DMF, HCON(..",
"CF2: CF3, CF2, CF",
"COO: COO",
"SIH2: SIH3, SIH2, SIH, SI",
"SIO: SIH2O, SIHO, SIO",
"NMP: NMP",
"CCLF: CCL3F, CCL2F, HCCL2F, HCCLF, CCLF2, HCCLF2, CCLF3, CCL2F2",
"CON: CONH2, CONHCH3, CONHCH2, CON(CH3)2, CONCH3CH2, CON(CH2)2",
"OCCOH: C2H2O2, C2H4O2",
"CH2S: CH3S, CH2S, CHS",
"morpholine: MORPH",
"thiophene: C4H4S, C4H3S, C4H2S",
"NCO: NCO",
"sulfones: (CH2)2SU, CH2CHSU",
"IMIDAZOL: IMIDAZOL",
"BTI: BTI",
"composed: composed structures",
"impossibles: impossible structures",
"epoxy: epoxides groups."
]

[project]
Expand All @@ -90,7 +33,7 @@ classifiers = [
"Topic :: Scientific/Engineering",
]

urls = {Homepage = "https://github.com/SalvadorBrandolin/ugrupy"}
urls = {Homepage = "https://github.com/SalvadorBrandolin/ugropy"}

dependencies = [
'numpy >= 1.25.1',
Expand Down
24 changes: 12 additions & 12 deletions tests/classic_unifac_groups/test_10_cho.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,48 @@


# =============================================================================
# 10- CHO Main group (aldehyde): CHO
# 10- HCO Main group (aldehyde): HCO
# =============================================================================

# UNIFAC
trials_unifac = [
("C(=O)C=O", {"CHO": 2}, "smiles"),
("C(=O)C=O", {"HCO": 2}, "smiles"),
# salicylaldehyde
(
"C1=CC=C(C(=C1)C=O)O",
{"ACH": 4, "ACOH": 1, "AC": 1, "CHO": 1},
{"ACH": 4, "ACOH": 1, "AC": 1, "HCO": 1},
"smiles",
),
# 2-Methyl-3-butenal
("CC(C=C)C=O", {"CH3": 1, "CH": 1, "CH2=CH": 1, "CHO": 1}, "smiles"),
("CC(C=C)C=O", {"CH3": 1, "CH": 1, "CH2=CH": 1, "HCO": 1}, "smiles"),
# Cinnamaldehyde
(
"C1=CC=C(C=C1)C=CC=O",
{"ACH": 5, "AC": 1, "CH=CH": 1, "CHO": 1},
{"ACH": 5, "AC": 1, "CH=CH": 1, "HCO": 1},
"smiles",
),
# benzaldehyde
("C1=CC=C(C=C1)C=O", {"ACH": 5, "AC": 1, "CHO": 1}, "smiles"),
("C1=CC=C(C=C1)C=O", {"ACH": 5, "AC": 1, "HCO": 1}, "smiles"),
# cyclohexanecarbaldehyde
(
"C1CCC(CC1)C=O",
{
"CH2": 5,
"CH": 1,
"CHO": 1,
"HCO": 1,
},
"smiles",
),
# pentanal
("CCCCC=O", {"CH3": 1, "CH2": 3, "CHO": 1}, "smiles"),
("CCCCC=O", {"CH3": 1, "CH2": 3, "HCO": 1}, "smiles"),
# 3-methylbutanal
("CC(C)CC=O", {"CH3": 2, "CH2": 1, "CH": 1, "CHO": 1}, "smiles"),
("CC(C)CC=O", {"CH3": 2, "CH2": 1, "CH": 1, "HCO": 1}, "smiles"),
# acetaldehyde
("CC=O", {"CH3": 1, "CHO": 1}, "smiles"),
("CC=O", {"CH3": 1, "HCO": 1}, "smiles"),
# 2-Hexyl-3-Phenyl-2-Propenal
(
r"CCCCCC\C(C=O)=C/C1=CC=CC=C1",
{"ACH": 5, "AC": 1, "CH=C": 1, "CH2": 5, "CH3": 1, "CHO": 1},
{"ACH": 5, "AC": 1, "CH=C": 1, "CH2": 5, "CH3": 1, "HCO": 1},
"smiles",
),
]
Expand All @@ -54,6 +54,6 @@
@pytest.mark.UNIFAC
@pytest.mark.PSRK
@pytest.mark.parametrize("identifier, result, identifier_type", trials_unifac)
def test_cho_unifac(identifier, result, identifier_type):
def test_HCO_unifac(identifier, result, identifier_type):
assert ug.get_unifac_groups(identifier, identifier_type) == result
assert ug.get_psrk_groups(identifier, identifier_type) == result
16 changes: 8 additions & 8 deletions tests/classic_unifac_groups/test_13_ch2o.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@


# =============================================================================
# 13- CH2O Main group: CH3O, CH2O, CH-O, THF
# 13- CH2O Main group: CH3O, CH2O, CHO, THF
# =============================================================================

# UNIFAC
trials_unifac = [
# 4-flavanol
(
"OC1CC(OC2=CC=CC=C12)C1=CC=CC=C1",
{"ACH": 9, "AC": 2, "ACCH": 1, "CH-O": 1, "CH2": 1, "OH": 1},
{"ACH": 9, "AC": 2, "ACCH": 1, "CHO": 1, "CH2": 1, "OH": 1},
"smiles",
),
(
Expand All @@ -28,15 +28,15 @@
# tetrahydrofuran
("C1CCOC1", {"THF": 1}, "smiles"),
# diisopropyl ether
("CC(C)OC(C)C", {"CH3": 4, "CH": 1, "CH-O": 1}, "smiles"),
("CC(C)OC(C)C", {"CH3": 4, "CH": 1, "CHO": 1}, "smiles"),
# diethyl ether
("CCOCC", {"CH3": 2, "CH2": 1, "CH2O": 1}, "smiles"),
# dimethyl ether
("COC", {"CH3": 1, "CH3O": 1}, "smiles"),
# 2H-Pyran, 2-(cyclohexyloxy)tetrahydro-
(
"C1CCC(CC1)OC2CCCCO2",
{"CH2": 8, "CH": 1, "CH2O": 1, "CH-O": 1},
{"CH2": 8, "CH": 1, "CH2O": 1, "CHO": 1},
"smiles",
),
# Problematic ones
Expand Down Expand Up @@ -80,20 +80,20 @@
("COCOC(C)OCOC", {"CH3O": 2, "CH2O": 2, "CH": 1, "CH3": 1}, "smiles"),
(
"CC(C)OCOC(C)OCOC(C)C",
{"CH3": 5, "CH": 1, "CHO": 2, "CH2O": 2},
{"CH3": 5, "CH": 1, "HCO": 2, "CH2O": 2},
"smiles",
),
(
"CC(C)OCOCC(OCOC(C)C)OCOC(C)C",
{"CH3": 6, "CH": 2, "CH2O": 4, "CHO": 2},
{"CH3": 6, "CH": 2, "CH2O": 4, "HCO": 2},
"smiles",
),
(
"CC(C)OCOC(OCOC(C)C)OCOC(C)C",
{"CH3": 6, "CHO": 3, "CH2O": 3, "CH": 1},
{"CH3": 6, "HCO": 3, "CH2O": 3, "CH": 1},
"smiles",
),
("CC(C)OCOC(C)C", {"CH3": 4, "CHO": 1, "CH2O": 1, "CH": 1}, "smiles"),
("CC(C)OCOC(C)C", {"CH3": 4, "HCO": 1, "CH2O": 1, "CH": 1}, "smiles"),
("CCOCOCC", {"CH3": 2, "CH2O": 2, "CH2": 1}, "smiles"),
("COCOC", {"CH3O": 2, "CH2": 1}, "smiles"),
# Impossibles
Expand Down
7 changes: 3 additions & 4 deletions tests/classic_unifac_groups/test_41_coo.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@
]


@pytest.mark.COO
@pytest.mark.UNIFAC
@pytest.mark.PSRK
@pytest.mark.parametrize("identifier, result, identifier_type", trials_unifac)
def test_coo_unifac(identifier, result, identifier_type):
groups = ug.Groups(identifier, identifier_type)
assert groups.unifac_groups == result
assert groups.psrk_groups == result
assert ug.get_unifac_groups(identifier, identifier_type) == result
assert ug.get_psrk_groups(identifier, identifier_type) == result
7 changes: 3 additions & 4 deletions tests/classic_unifac_groups/test_42_sih2.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
]


@pytest.mark.SIH2
@pytest.mark.UNIFAC
@pytest.mark.PSRK
@pytest.mark.parametrize("identifier, result, identifier_type", trials_unifac)
def test_sih2_unifac(identifier, result, identifier_type):
groups = ug.Groups(identifier, identifier_type)
assert groups.unifac_groups == result
assert groups.psrk_groups == result
assert ug.get_unifac_groups(identifier, identifier_type) == result
assert ug.get_psrk_groups(identifier, identifier_type) == result
Loading

0 comments on commit b61c53e

Please sign in to comment.