コード例 #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
コード例 #2
0
ファイル: test_system.py プロジェクト: SvenRogge/yaff
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
コード例 #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),
    ]
コード例 #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),
    ]
コード例 #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)]
コード例 #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
コード例 #7
0
ファイル: test_system.py プロジェクト: SvenRogge/yaff
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
コード例 #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)]