Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gdb format molecule reading #291

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
format and changelog
  • Loading branch information
loriab committed Jun 11, 2022
commit 03a13805074033a870f8788dea0a0e372104cd3f
11 changes: 8 additions & 3 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ Changelog
.. +++++++++


0.25.0 / 2022-MM-DD
0.25.0 / 2022-06-DD
-------------------

Breaking Changes
++++++++++++++++

New Features
++++++++++++
- (:pr:`288`, :pr:`291`) The molecule ``from_string`` parser learned new format
``dtype="gdb"`` from https://www.nature.com/articles/sdata201422/tables/3 .
At present, dtype must be specified explicitly to trigger this parsing; it is
not in the customary fallback sequence of unspecified dtype.

Enhancements
++++++++++++
Expand All @@ -37,8 +41,9 @@ Enhancements

Bug Fixes
+++++++++
- (:pr:`286`) Sphinx autodocumentation with typing of ``qcelemental.testing.compare_recursive`` no longer
warns about circular import.
- (:pr:`286`) Sphinx autodocumentation with typing of
``qcelemental.testing.compare_recursive`` no longer warns about circular
import.


0.24.0 / 2021-11-18
Expand Down
37 changes: 25 additions & 12 deletions qcelemental/tests/test_molparse_from_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,10 +920,12 @@ def test_xyzp_qm_7e():
assert compare_recursive(ans7, intermed, tnm() + ": intermediate")
assert compare_molrecs(fullans, final["qm"], tnm() + ": full qm")


@pytest.mark.parametrize(
"string",
[
pytest.param("""5
pytest.param(
"""5
gdb 1 157.7118 157.70997 157.70699 0. 13.21 -0.3877 0.1171 0.5048 35.3641 0.044749 -40.47893 -40.476062 -40.475117 -40.498597 6.469
C -0.0126981359 1.0858041578 0.0080009958 -0.535689
H 0.002150416 -0.0060313176 0.0019761204 0.133921
Expand All @@ -932,8 +934,11 @@ def test_xyzp_qm_7e():
H -0.5238136345 1.4379326443 0.9063972942 0.133923
1341.307 1341.3284 1341.365 1562.6731 1562.7453 3038.3205 3151.6034 3151.6788 3151.7078
C C
InChI=1S/CH4/h1H4 InChI=1S/CH4/h1H4""", id="gdb missing atom charge"),
pytest.param("""5
InChI=1S/CH4/h1H4 InChI=1S/CH4/h1H4""",
id="gdb missing atom charge",
),
pytest.param(
"""5
catinhat 5 1.0 2.0 3.0
C -0.0126981359 1.0858041578 0.0080009958 -0.535689
H 0.002150416 -0.0060313176 0.0019761204 0.133921
Expand All @@ -942,8 +947,11 @@ def test_xyzp_qm_7e():
H -0.5238136345 1.4379326443 0.9063972942 0.133923
1341.307 1341.3284 1341.365 1562.6731 1562.7453 3038.3205 3151.6034 3151.6788 3151.7078
C C
InChI=1S/CH4/h1H4 InChI=1S/CH4/h1H4""", id="gdb bad properties line"),
pytest.param("""5
InChI=1S/CH4/h1H4 InChI=1S/CH4/h1H4""",
id="gdb bad properties line",
),
pytest.param(
"""5
gdb 1 157.7118 157.70997 157.70699 0. 13.21 -0.3877 0.1171 0.5048 35.3641 0.044749 -40.47893 -40.476062 -40.475117 -40.498597 6.469
C -0.0126981359 1.0858041578 0.0080009958 -0.535689
H 0.002150416 -0.0060313176 0.0019761204 0.133921
Expand All @@ -952,8 +960,11 @@ def test_xyzp_qm_7e():
H -0.5238136345 1.4379326443 0.9063972942 0.133923
1341.307 1341.3284 1341.365 1562.6731 1562.7453 3038.3205 3151.6034
C C
InChI=1S/CH4/h1H4 InChI=1S/CH4/h1H4""", id="gdb freq short"),
pytest.param("""5
InChI=1S/CH4/h1H4 InChI=1S/CH4/h1H4""",
id="gdb freq short",
),
pytest.param(
"""5
gdb 1 157.7118 157.70997 157.70699 0. 13.21 -0.3877 0.1171 0.5048 35.3641 0.044749 -40.47893 -40.476062 -40.475117 -40.498597 6.469
C -0.0126981359 1.0858041578 0.0080009958 -0.535689
H 0.002150416 -0.0060313176 0.0019761204 0.133921
Expand All @@ -962,8 +973,10 @@ def test_xyzp_qm_7e():
H -0.5238136345 1.4379326443 0.9063972942 0.133923
1341.307 1341.3284 1341.365 1562.6731 1562.7453 3038.3205 3151.6034 3151.6788 3151.7078 12.0 12.0
C C
InChI=1S/CH4/h1H4 InChI=1S/CH4/h1H4""", id="gdb freq long"),
]
InChI=1S/CH4/h1H4 InChI=1S/CH4/h1H4""",
id="gdb freq long",
),
],
)
def test_xyz_gdb_error(string):

Expand Down Expand Up @@ -1003,7 +1016,7 @@ def test_xyz_gdb_error(string):
1.4379326443,
0.9063972942,
],
id="methane"
id="methane",
),
pytest.param(
"""20
Expand Down Expand Up @@ -1095,7 +1108,7 @@ def test_xyz_gdb_error(string):
-4.5389119798,
2.3916335805,
],
id="mol2"
id="mol2",
),
pytest.param(
"""17
Expand Down Expand Up @@ -1175,7 +1188,7 @@ def test_xyz_gdb_error(string):
-2.687136563,
0.4367361986,
],
id="mol3"
id="mol3",
),
],
)
Expand Down