コード例 #1
0
ファイル: test_inchi.py プロジェクト: sjklipp/autochem_1219
def test__from_data():
    """ test getters
    """
    assert AR_ICH == inchi.standard_form(
        inchi.from_data(fml_slyr=inchi.formula_sublayer(AR_ICH), ))

    assert CH2O2_ICH == inchi.standard_form(
        inchi.from_data(
            fml_slyr=inchi.formula_sublayer(CH2O2_ICH),
            main_dct=inchi.main_sublayers(CH2O2_ICH),
            char_dct=inchi.charge_sublayers(CH2O2_ICH),
        ))

    assert C2H6O_ICH == inchi.standard_form(
        inchi.from_data(
            fml_slyr=inchi.formula_sublayer(C2H6O_ICH),
            main_dct=inchi.main_sublayers(C2H6O_ICH),
            iso_dct=inchi.isotope_sublayers(C2H6O_ICH),
        ))

    assert C2H2F2_ICH == inchi.standard_form(
        inchi.from_data(
            fml_slyr=inchi.formula_sublayer(C2H2F2_ICH),
            main_dct=inchi.main_sublayers(C2H2F2_ICH),
            ste_dct=inchi.stereo_sublayers(C2H2F2_ICH),
        ))

    assert C8H13O_ICH == inchi.standard_form(
        inchi.from_data(
            fml_slyr=inchi.formula_sublayer(C8H13O_ICH),
            main_dct=inchi.main_sublayers(C8H13O_ICH),
            ste_dct=inchi.stereo_sublayers(C8H13O_ICH),
        ))
コード例 #2
0
ファイル: test_inchi.py プロジェクト: sjklipp/autochem_1219
def test__standard_form():
    """ test inchi.standard_form
    """
    assert (inchi.standard_form(C2H6O_ICH,
                                remove_stereo=True) == C2H6O_ICH_NO_STEREO)
    assert (inchi.standard_form(C4H5F2O_ICH,
                                remove_stereo=True) == C4H5F2O_ICH_NO_STEREO)
    assert (inchi.standard_form(C2H2F2_ICH,
                                remove_stereo=True) == C2H2F2_ICH_NO_STEREO)
    assert (inchi.standard_form(C8H13O_ICH,
                                remove_stereo=True) == C8H13O_ICH_NO_STEREO)
コード例 #3
0
ファイル: test_inchi.py プロジェクト: sjklipp/autochem_1219
def test__join():
    """ test inchi.join
    """
    assert (inchi.standard_form(inchi.join(
        inchi.split(C4H10ZN_ICH))) == C4H10ZN_ICH)
    assert (inchi.standard_form(inchi.join(
        inchi.split(C4H5F2O_ICH))) == C4H5F2O_ICH)

    ich = ('InChI=1S/C3H7O4.C2H5FO/c1-3(7-5)2-6-4;1-2(3)4/'
           'h3,5H,2H2,1H3;2,4H,1H3/t3-;2-/m01/s1')
    assert inchi.standard_form(inchi.join(inchi.split(ich))) == ich
コード例 #4
0
ファイル: test_inchi.py プロジェクト: Auto-Mech/autochem
def test__has_stereo():
    """ test inchi.has_stereo
    """
    assert inchi.has_stereo(C2H6O_ICH)
    assert inchi.has_stereo(C4H5F2O_ICH)
    assert inchi.has_stereo(C2H2F2_ICH)
    assert inchi.has_stereo(C8H13O_ICH)
    assert not inchi.has_stereo(inchi.standard_form(C2H6O_ICH, stereo=False))
    assert not inchi.has_stereo(inchi.standard_form(C4H5F2O_ICH, stereo=False))
    assert not inchi.has_stereo(inchi.standard_form(C2H2F2_ICH, stereo=False))
    assert not inchi.has_stereo(inchi.standard_form(C8H13O_ICH, stereo=False))