コード例 #1
0
def test_unique_confs():

    conf1 = Conformer()
    conf2 = Conformer()
    conf3 = Conformer()

    # Set two energies the same and leave one as none..
    conf1.energy = 1
    conf2.energy = 1

    unique_confs = get_unique_confs(conformers=[conf1, conf2, conf3])
    assert len(unique_confs) == 1
    assert type(unique_confs[0]) is Conformer
    assert unique_confs[0].energy == 1
コード例 #2
0
def test_unique_confs_none():

    conf1 = Conformer()
    conf1.energy = 0.1

    # Conformer with energy just below the threshold
    conf2 = Conformer()
    conf2.energy = 0.1 + (0.9 / Constants.ha2kJmol)

    unique_confs = get_unique_confs(conformers=[conf1, conf2],
                                    energy_threshold_kj=1)
    assert len(unique_confs) == 1

    # If the energy is above the threshold there should be two unique
    # conformers
    conf2.energy += 0.2 / Constants.ha2kJmol
    unique_confs = get_unique_confs(conformers=[conf1, conf2],
                                    energy_threshold_kj=1)
    assert len(unique_confs) == 2