コード例 #1
0
ファイル: test_topology_analysis.py プロジェクト: ngchc/TMD
def test_closest_ph__very_small_target_extent():

    ph_list = _ph_list()

    target_extent = 2.0

    closest_index = analysis.closest_ph(ph_list,
                                        target_extent,
                                        method='from_above')
    assert_equal(closest_index, 6)

    closest_index = analysis.closest_ph(ph_list,
                                        target_extent,
                                        method='from_below')
    assert_equal(closest_index, 6)

    closest_index = analysis.closest_ph(ph_list,
                                        target_extent,
                                        method='nearest')
    assert_equal(closest_index, 6)
コード例 #2
0
ファイル: test_topology_analysis.py プロジェクト: ngchc/TMD
def test_closest_ph__exact_match_target_extent():

    ph_list = _ph_list()

    target_extent = 24.0

    closest_index = analysis.closest_ph(ph_list,
                                        target_extent,
                                        method='from_above')
    assert_equal(closest_index, 2)

    closest_index = analysis.closest_ph(ph_list,
                                        target_extent,
                                        method='from_below')
    assert_equal(closest_index, 2)

    closest_index = analysis.closest_ph(ph_list,
                                        target_extent,
                                        method='nearest')
    assert_equal(closest_index, 2)
コード例 #3
0
ファイル: test_topology_analysis.py プロジェクト: ngchc/TMD
def test_closest_ph__reasonable_target_extent():

    ph_list = _ph_list()

    target_extent = 6.0

    closest_index = analysis.closest_ph(ph_list,
                                        target_extent,
                                        method='from_above')
    assert_equal(closest_index, 5)

    closest_index = analysis.closest_ph(ph_list,
                                        target_extent,
                                        method='from_below')
    assert_equal(closest_index, 6)

    closest_index = analysis.closest_ph(ph_list,
                                        target_extent,
                                        method='nearest')
    assert_equal(closest_index, 5)