Example #1
0
    def test_simple_matching(self):
        dg = tn.graph_socioPatterns2012(tn.DynGraphSN)
        dg = dg.aggregate_sliding_window(60*60*24)

        coms = DCD.iterative_match(dg)

        tn.write_com_SN(coms,"testDir")
        shutil.rmtree("testDir")
Example #2
0
    def test_dynamo(self):
        dg = tn.graph_socioPatterns2012(tn.DynGraphSN)
        dg = dg.aggregate_time_period("day")

        coms = DCDextern.dynamo(dg)

        tn.write_com_SN(coms, "testDir")
        shutil.rmtree("testDir")
Example #3
0
    def test_mucha(self):
        dg = tn.graph_socioPatterns2012(tn.DynGraphSN)
        dg = dg.aggregate_sliding_window(60 * 60 * 24)

        coms = DCDextern.transversal_network_mucha_original(dg)

        tn.write_com_SN(coms, "testDir")
        shutil.rmtree("testDir")
Example #4
0
    def test_survival_graph(self):
        dg = tn.graph_socioPatterns2012(tn.DynGraphSN)
        dg = dg.aggregate_sliding_window(60 * 60 * 24)

        coms = DCD.label_smoothing(dg)

        tn.write_com_SN(coms, "testDir")
        shutil.rmtree("testDir")
Example #5
0
    def test_k_cliques(self):
        dg = tn.graph_socioPatterns2012(tn.DynGraphSN)
        dg = dg.aggregate_sliding_window(60 * 60 * 24)

        coms = DCD.rollingCPM(dg)

        tn.write_com_SN(coms, "testDir")
        shutil.rmtree("testDir")
Example #6
0
    def test_SN2IG2SN(self):
        sn = tn.graph_socioPatterns2012(format=tn.DynGraphSN)
        ig = sn.to_DynGraphIG()
        sn2 = ig.to_DynGraphSN(slices=20)

        self.assertEqual(sn.snapshots_timesteps(), sn2.snapshots_timesteps())
        for t in sn.snapshots_timesteps():
            self.assertEqual(
                sn.graph_at_time(t).edges(),
                sn2.graph_at_time(t).edges())
Example #7
0
    def test_SN2IGaggregatePeriod(self):
        dg = tn.graph_socioPatterns2012(format=tn.DynGraphSN)
        dgd = dg.aggregate_sliding_window(60 * 60 * 24)
        sg = dgd.to_DynGraphIG()
        dg2 = sg.to_DynGraphSN(60 * 60 * 24)

        self.assertEqual(dgd.snapshots_timesteps(), dg2.snapshots_timesteps())
        for t in dgd.snapshots_timesteps():
            self.assertEqual(
                dgd.graph_at_time(t).edges(),
                dg2.graph_at_time(t).edges())
Example #8
0
    def test_aggregateDay(self):
        dg = tn.graph_socioPatterns2012(format=tn.DynGraphSN)
        dgd = dg.aggregate_time_period("day")
        sg = dgd.to_DynGraphIG()
        dg2 = sg.to_DynGraphSN(60 * 60 * 24)

        self.assertEqual(dgd.snapshots_timesteps(), dg2.snapshots_timesteps())
        for t in dgd.snapshots_timesteps():
            self.assertEqual(
                dgd.graph_at_time(t).edges(),
                dg2.graph_at_time(t).edges())
Example #9
0
    def test_SN2LS2SN(self):
        sn = tn.graph_socioPatterns2012(format=tn.DynGraphSN)
        sn = sn.aggregate_sliding_window(60 * 60 * 24)
        ls = sn.to_DynGraphLS()
        sn2 = ls.to_DynGraphSN(slices=20, weighted=False)

        self.assertEqual(sn.snapshots_timesteps(), sn2.snapshots_timesteps())
        for t in sn.snapshots_timesteps():
            self.assertEqual(
                sn.graph_at_time(t).edges(),
                sn2.graph_at_time(t).edges())
Example #10
0
 def test_IG2SN2IG(self):
     ig = tn.graph_socioPatterns2012(format=tn.DynGraphIG)
     sn = ig.to_DynGraphSN(slices=20)
     ig2 = sn.to_DynGraphIG()
     self.assertEqual(ig.interactions(), ig2.interactions())