Пример #1
0
def test__from_data():
    """ test zmatrix.from_data
    """
    assert geom.is_valid(H_ZMA) is False
    assert geom.is_valid(HO_ZMA) is False
    assert geom.is_valid(HO2_ZMA) is False
    assert geom.is_valid(H2O2_ZMA) is False
    assert geom.is_valid(CH4O_ZMA) is False

    assert H_ZMA == zmatrix.from_data(
        symbols=zmatrix.symbols(H_ZMA),
        distance_column=zmatrix.distance_column(H_ZMA),
        angle_column=zmatrix.angle_column(H_ZMA),
        torsion_column=zmatrix.torsion_column(H_ZMA),
        angstroms=False,
        one_indexed=False,
    )
    assert HO_ZMA == zmatrix.from_data(
        symbols=zmatrix.symbols(HO_ZMA),
        distance_column=zmatrix.distance_column(HO_ZMA),
        angle_column=zmatrix.angle_column(HO_ZMA),
        torsion_column=zmatrix.torsion_column(HO_ZMA),
        angstroms=False,
        one_indexed=False,
    )
    assert HO2_ZMA == zmatrix.from_data(
        symbols=zmatrix.symbols(HO2_ZMA),
        distance_column=zmatrix.distance_column(HO2_ZMA),
        angle_column=zmatrix.angle_column(HO2_ZMA),
        torsion_column=zmatrix.torsion_column(HO2_ZMA),
        angstroms=False,
        one_indexed=False,
    )
    assert H2O2_ZMA == zmatrix.from_data(
        symbols=zmatrix.symbols(H2O2_ZMA),
        distance_column=zmatrix.distance_column(H2O2_ZMA),
        angle_column=zmatrix.angle_column(H2O2_ZMA),
        torsion_column=zmatrix.torsion_column(H2O2_ZMA),
        angstroms=False,
        one_indexed=False,
    )
    assert CH4O_ZMA == zmatrix.from_data(
        symbols=zmatrix.symbols(CH4O_ZMA),
        distance_column=zmatrix.distance_column(CH4O_ZMA),
        angle_column=zmatrix.angle_column(CH4O_ZMA),
        torsion_column=zmatrix.torsion_column(CH4O_ZMA),
        angstroms=False,
        one_indexed=False,
    )
Пример #2
0
def test__is_valid():
    """ test geom.is_valid
    """

    # Check validity
    assert geom.is_valid(C2H2CLF_GEO)
    # with pytest.raises(ValueError):
    #     geom.is_valid(BAD_GEO)

    # Check empty geom returns empty information
    assert not geom.symbols(())
    assert not geom.coordinates(())
Пример #3
0
def test__is_valid():
    """ test geom.is_valid
    """
    assert geom.is_valid(C2H2CLF_GEO)