Esempio n. 1
0
 def test_n_FindPaths(self):
     tprob = scipy.io.mmread(os.path.join(ReferenceDir, "Data", "tProb.mtx"))
     sources = [0]
     sinks = [70]
     paths, bottlenecks, fluxes = FindPaths.run(tprob, sources, sinks, 10)
     # paths are hard to test due to type issues, adding later --TJL
     bottlenecks_ref = io.loadh(os.path.join(ReferenceDir, "transition_path_theory_reference", "dijkstra_bottlenecks.h5"), 'Data')
     fluxes_ref = io.loadh(os.path.join(ReferenceDir, "transition_path_theory_reference", "dijkstra_fluxes.h5"), 'Data')
     npt.assert_array_almost_equal(bottlenecks, bottlenecks_ref)
     npt.assert_array_almost_equal(fluxes, fluxes_ref)
Esempio n. 2
0
def test_FindPaths():
    tprob = get("transition_path_theory_reference/tProb.mtx")
    sources = [0]
    sinks = [70]
    paths, bottlenecks, fluxes = FindPaths.run(tprob, sources, sinks, 10)
    # paths are hard to test due to type issues, adding later --TJL
    bottlenecks_ref = get(pjoin("transition_path_theory_reference",
                           "dijkstra_bottlenecks.h5"))['Data']
    fluxes_ref = get(pjoin("transition_path_theory_reference",
                      "dijkstra_fluxes.h5"))['Data']
    eq(bottlenecks, bottlenecks_ref)
    eq(fluxes, fluxes_ref)
Esempio n. 3
0
    def test_multi_state_path_calculations(self):
        path_output = FindPaths.run(self.tprob, self.multi_sources, self.multi_sinks, self.num_paths)

        path_result_ref = io.loadh(tpt_get("many_state/Paths.h5"))

        paths_ref = path_result_ref['Paths']
        bottlenecks_ref = path_result_ref['Bottlenecks']
        fluxes_ref = path_result_ref['fluxes']

        npt.assert_array_almost_equal(path_output[0], paths_ref)
        npt.assert_array_almost_equal(path_output[1], bottlenecks_ref)
        npt.assert_array_almost_equal(path_output[2], fluxes_ref)
def test_FindPaths():
    tprob = get("transition_path_theory_reference/tProb.mtx")
    sources = [0]
    sinks = [70]
    paths, bottlenecks, fluxes = FindPaths.run(tprob, sources, sinks, 10)
    # paths are hard to test due to type issues, adding later --TJL
    bottlenecks_ref = get(pjoin("transition_path_theory_reference",
                           "dijkstra_bottlenecks.h5"))['Data']
    fluxes_ref = get(pjoin("transition_path_theory_reference",
                      "dijkstra_fluxes.h5"))['Data']
    eq(bottlenecks, bottlenecks_ref)
    eq(fluxes, fluxes_ref)
Esempio n. 5
0
    def test_multi_state_path_calculations(self):
        path_output = FindPaths.run(self.tprob, self.multi_sources, self.multi_sinks, self.num_paths)

        path_result_ref = io.loadh(tpt_get("many_state/Paths.h5"))

        paths_ref = path_result_ref['Paths']
        bottlenecks_ref = path_result_ref['Bottlenecks']
        fluxes_ref = path_result_ref['fluxes']

        npt.assert_array_almost_equal(path_output[0], paths_ref)
        npt.assert_array_almost_equal(path_output[1], bottlenecks_ref)
        npt.assert_array_almost_equal(path_output[2], fluxes_ref)
Esempio n. 6
0
 def test_n_FindPaths(self):
     tprob = scipy.io.mmread(os.path.join(ReferenceDir, "Data",
                                          "tProb.mtx"))
     sources = [0]
     sinks = [70]
     paths, bottlenecks, fluxes = FindPaths.run(tprob, sources, sinks, 10)
     # paths are hard to test due to type issues, adding later --TJL
     bottlenecks_ref = io.loadh(
         os.path.join(ReferenceDir, "transition_path_theory_reference",
                      "dijkstra_bottlenecks.h5"), 'Data')
     fluxes_ref = io.loadh(
         os.path.join(ReferenceDir, "transition_path_theory_reference",
                      "dijkstra_fluxes.h5"), 'Data')
     npt.assert_array_almost_equal(bottlenecks, bottlenecks_ref)
     npt.assert_array_almost_equal(fluxes, fluxes_ref)