Showing 1 of 3 files from the diff.
Other files ignored by Codecov

@@ -0,0 +1,60 @@
Loading
1 +
import pytest
2 +
3 +
import qcfractal.interface as ptl
4 +
from qcfractal.interface.models import GridOptimizationInput
5 +
from qcfractal.testing import fractal_compute_server, using_geometric, using_rdkit
6 +
7 +
@using_geometric
8 +
@using_rdkit
9 +
def test_service_gridoptimization_single_noopt(fractal_compute_server):
10 +
11 +
    client = ptl.FractalClient(fractal_compute_server)
12 +
13 +
    # Add a HOOH
14 +
    hooh = ptl.data.get_molecule("hooh.json")
15 +
    initial_distance = hooh.measure([1, 2])
16 +
17 +
    # Options
18 +
    service = GridOptimizationInput(**{
19 +
        "keywords": {
20 +
            "preoptimization": False,
21 +
            "scans": [{
22 +
                "type": "distance",
23 +
                "indices": [1, 2],
24 +
                "steps": [-0.1, 0.0],
25 +
                "step_type": "relative"
26 +
            }]
27 +
        },
28 +
        "optimization_spec": {
29 +
            "program": "geometric",
30 +
            "keywords": {
31 +
                "coordsys": "tric",
32 +
            }
33 +
        },
34 +
        "qc_spec": {
35 +
            "driver": "gradient",
36 +
            "method": "UFF",
37 +
            "basis": "",
38 +
            "keywords": None,
39 +
            "program": "rdkit",
40 +
        },
41 +
        "initial_molecule": hooh,
42 +
    }) # yapf: disable
43 +
44 +
    ret = client.add_service([service])
45 +
    fractal_compute_server.await_services()
46 +
    assert len(fractal_compute_server.list_current_tasks()) == 0
47 +
48 +
    result = client.query_procedures(id=ret.ids)[0]
49 +
50 +
    assert result.status == "COMPLETE"
51 +
    assert result.starting_grid == (1, )
52 +
    assert pytest.approx(result.get_final_energies((0, )), abs=1.e-4) == 0.00032145876568280524
53 +
54 +
    assert result.starting_molecule == result.initial_molecule
55 +
56 +
    # Check initial vs startin molecule
57 +
    assert result.initial_molecule == result.starting_molecule
58 +
59 +
    mol = client.query_molecules(id=result.starting_molecule)[0]
60 +
    assert pytest.approx(mol.measure([1, 2])) == initial_distance
Files Coverage
quanformer 51.85%
Project Totals (24 files) 51.85%
250.1
TRAVIS_OS_NAME=osx
232.1
TRAVIS_OS_NAME=osx
233.1
TRAVIS_OS_NAME=osx
234.1
TRAVIS_OS_NAME=osx
235.1
TRAVIS_OS_NAME=osx
228.1
TRAVIS_OS_NAME=osx
229.1
TRAVIS_OS_NAME=osx
230.1
TRAVIS_OS_NAME=osx
231.1
TRAVIS_OS_NAME=osx
236.1
TRAVIS_OS_NAME=osx
237.1
TRAVIS_OS_NAME=osx
248.1
TRAVIS_OS_NAME=osx
249.1
TRAVIS_OS_NAME=osx
211.1
TRAVIS_OS_NAME=osx
211.2
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
212.1
TRAVIS_OS_NAME=osx
212.2
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
213.1
TRAVIS_OS_NAME=osx
213.2
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
214.2
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux