Beispiel #1
0
def test_detect_bonds_cyclopropene_exceptions():
    system = get_system_cyclopropene()
    # create system without bonds
    system = System(system.numbers, system.pos)
    # Add bonds between all hydrogen and carbon atoms (unrealistic but useful for testing)
    system.detect_bonds({(1,6): 8.0*angstrom})
    assert system.nbond == 3+4*3
Beispiel #2
0
def test_detect_bonds_cyclopropene_exceptions():
    system = get_system_cyclopropene()
    # create system without bonds
    system = System(system.numbers, system.pos)
    # Add bonds between all hydrogen and carbon atoms (unrealistic but useful for testing)
    system.detect_bonds({(1, 6): 8.0 * angstrom})
    assert system.nbond == 3 + 4 * 3
Beispiel #3
0
def test_iter_matches_cyclopropene_cyclopropene():
    system = get_system_cyclopropene()
    result = sorted(system.iter_matches(system))
    assert result == [
        (0, 1, 2, 3, 4, 5, 6),
        (0, 1, 2, 4, 3, 5, 6),
        (0, 2, 1, 3, 4, 6, 5),
        (0, 2, 1, 4, 3, 6, 5),
    ]
Beispiel #4
0
def test_iter_matches_cyclopropene_cyclopropene():
    system = get_system_cyclopropene()
    result = sorted(system.iter_matches(system))
    assert result == [
        (0, 1, 2, 3, 4, 5, 6),
        (0, 1, 2, 4, 3, 5, 6),
        (0, 2, 1, 3, 4, 6, 5),
        (0, 2, 1, 4, 3, 6, 5),
    ]
Beispiel #5
0
def test_iter_matches_cyclopropene_ch():
    system0 = get_system_cyclopropene()
    system1 = system0.subsystem([0, 4])
    result = sorted(system0.iter_matches(system1))
    assert result == [(0, 3), (0, 4), (1, 5), (2, 6)]
Beispiel #6
0
def test_iter_bonds_empty():
    system = get_system_cyclopropene()
    system.bonds = None
    assert len(list(system.iter_bonds())) == 0
    assert len(list(system.iter_angles())) == 0
    assert len(list(system.iter_dihedrals())) == 0
Beispiel #7
0
def test_iter_bonds_empty():
    system = get_system_cyclopropene()
    system.bonds = None
    assert len(list(system.iter_bonds())) == 0
    assert len(list(system.iter_angles())) == 0
    assert len(list(system.iter_dihedrals())) == 0
Beispiel #8
0
def test_iter_matches_cyclopropene_ch():
    system0 = get_system_cyclopropene()
    system1 = system0.subsystem([0, 4])
    result = sorted(system0.iter_matches(system1))
    assert result == [(0, 3), (0, 4), (1, 5), (2, 6)]