コード例 #1
0
    def test_plot(self):
        phy = PhyBo(self.inputfile, output_dir=self.tmp.as_posix())
        phy.get_GLS()
        glm = list(phy.stats.keys())[0]
        phy.plot_GLS(glm)
        phy.plot_ACS(glm)

        for method in ['bc', 'td', 'mr']:
            phy.get_MLN(glm, method=method)

        phy.plot_MLN(glm)
        phy.plot_MLN_3d(glm)
        phy.analyze(runs=[('weighted', (2, 1))], output_gml=True,
                    output_plot=True)
        phy.get_IVSD()
        phy.get_ACS(phy.best_model)
        phy.get_MSN(phy.best_model)
        phy.get_MSN(phy.best_model, deep_nodes=True)
        phy.plot_MSN(phy.best_model, conf=phy.conf)
        phy.plot_two_concepts('I', '15:2', '16:2')
        edge1, edge2 = list(phy.graph[phy.best_model].edges())[0]
        phy.get_edge(phy.best_model, edge1, edge2)
        phy.get_edge(phy.best_model, 'Beijing', 'Shanghai')
        phy.get_edge(phy.best_model, edge1, edge2, msn=True)
        phy.get_PDC('w-2-1', aligned_output=True)
        phy.plot_concept_evolution(phy.best_model, concept="I")
コード例 #2
0
ファイル: test_phylogeny.py プロジェクト: kadster/lingpy
def test_plot(inputfile, mocker, Bmp, Sp, Plt, tmppath):
    mocker.patch('lingpy.compare.phylogeny.mpl', new=mocker.MagicMock())
    mocker.patch('lingpy.compare.phylogeny.gls2gml', new=mocker.MagicMock())
    mocker.patch('lingpy.compare.phylogeny.plot_tree', new=mocker.MagicMock())
    mocker.patch('lingpy.compare.phylogeny.bmp', new=Bmp)
    mocker.patch('lingpy.compare.phylogeny.plt', new=Plt)
    mocker.patch('lingpy.compare.phylogeny.sp', new=Sp)

    phy = PhyBo(inputfile, output_dir=str(tmppath))
    phy.get_GLS()
    glm = list(phy.stats.keys())[0]
    phy.plot_GLS(glm)
    phy.plot_ACS(glm)

    for method in ['bc', 'td', 'mr']:
        phy.get_MLN(glm, method=method)

    phy.plot_MLN(glm)
    phy.plot_MLN_3d(glm)
    phy.analyze(runs=[('weighted', (2, 1))], output_gml=True, output_plot=True)
    phy.get_IVSD()
    phy.get_ACS(phy.best_model)
    phy.get_MSN(phy.best_model)
    phy.get_MSN(phy.best_model, deep_nodes=True)
    phy.plot_MSN(phy.best_model, conf=phy.conf)
    phy.plot_two_concepts('I', '15:2', '16:2')
    edge1, edge2 = list(phy.graph[phy.best_model].edges())[0]
    phy.get_edge(phy.best_model, edge1, edge2)
    phy.get_edge(phy.best_model, 'Beijing', 'Shanghai')
    phy.get_edge(phy.best_model, edge1, edge2, msn=True)
    phy.get_PDC('w-2-1', aligned_output=True)
    phy.plot_concept_evolution(phy.best_model, concept="I")
コード例 #3
0
 def test_plot(self):
     phy = PhyBo(self.inputfile, output_dir=self.tmp)
     phy.get_GLS()
     glm = list(phy.stats.keys())[0]
     phy.plot_concept_evolution(glm)
     phy.plot_GLS(glm)
     phy.plot_ACS(glm)
     phy.get_MLN(glm)
     phy.graph = defaultdict(lambda: Graph())
     phy.plot_MLN(glm)
     phy.analyze()
     phy.get_IVSD()
     phy.get_MSN()
     glm = list(phy.geograph.keys())[0]
     phy.geograph[glm] = MagicMock(
         edges=lambda **kw: [(MagicMock(), MagicMock(), defaultdict(lambda: 2))])
     phy._meta['conf'] = dict(linescale=2, groups_colors=defaultdict(lambda: 'a'))
     phy.plot_MSN(glm)
コード例 #4
0
 def test_plot(self):
     phy = PhyBo(self.inputfile, output_dir=self.tmp)
     phy.get_GLS()
     glm = list(phy.stats.keys())[0]
     phy.plot_concept_evolution(glm)
     phy.plot_GLS(glm)
     phy.plot_ACS(glm)
     phy.get_MLN(glm)
     phy.graph = defaultdict(lambda: Graph())
     phy.plot_MLN(glm)
     phy.analyze()
     phy.get_IVSD()
     phy.get_MSN()
     glm = list(phy.geograph.keys())[0]
     phy.geograph[glm] = MagicMock(edges=lambda **kw: [(MagicMock(
     ), MagicMock(), defaultdict(lambda: 2))])
     phy._meta['conf'] = dict(linescale=2,
                              groups_colors=defaultdict(lambda: 'a'))
     phy.plot_MSN(glm)