Example #1
0
    def test_set(self):
        iax1, _, _ = circle_plot_residues([np.arange(20)])
        iax2, _, _ = circle_plot_residues([np.arange(40)])

        fs1, fs2 = [_utils.fontsize_get(iax)["n_polygons"][0] for iax in [iax1, iax2]]
        assert fs1 != fs2

        _utils.fontsize_apply(iax1, iax2)
        new_fs2 = _utils.fontsize_get(iax2)["n_polygons"][0]
        assert fs1 == new_fs2
Example #2
0
 def test_raises(self):
     iax, xy, cpr_dict = circle_plot_residues([np.arange(50),
                                               np.arange(50, 100)],
                                              )
     with self.assertRaises(NotImplementedError):
         _utils.add_aura(xy, -np.mod(np.arange(len(xy)), 3), iax, r=cpr_dict["r"],
                         lines=True)
Example #3
0
    def test_get(self):
        iax, _, _ = circle_plot_residues([np.arange(20)])

        fs = _utils.fontsize_get(iax)
        self.assertSequenceEqual(["n_polygons", "other"], list(fs.keys()))
        assert len(fs["other"]) == 0
        assert len(fs["n_polygons"]) == 1
        print(np.unique([tt.get_fontsize() for tt in iax.texts]))
        self.assertSequenceEqual(fs["n_polygons"], np.unique([np.round(tt.get_fontsize(), 2) for tt in iax.texts]))
Example #4
0
 def test_works(self):
     iax, xy, cpr_dict = flare.circle_plot_residues([np.arange(5),
                                          np.arange(5, 10)],
                                         #ss_array=["H"] * 10,
                                         #fragment_names=["A", "B"]
                                          )
     pairs = [[0,5],
              [5,6],
              [9,3]
              ]
     node_pairs = [(xy[ii],xy[jj]) for (ii,jj) in pairs]
     bzcurves =  flare.add_bezier_curves(iax,node_pairs
                                       )
Example #5
0
 def test_works(self):
     iax, _, cpr_dict =  flare.circle_plot_residues([np.arange(50),
                                                     np.arange(50, 100)],
                                                    ss_array=["H"] * 100,
                                                    fragment_names=["A", "B"],
                                                    textlabels={0:"first",99:"last"},
                                                    aura=np.arange(100),
                                                    )
     for key in ["fragment_labels",
                 "dot_labels",
                 "dots",
                 "SS_labels"
                 ]:
         assert key in cpr_dict.keys()
Example #6
0
    def test_works(self):
        plt.figure(figsize=(5, 5))
        iax = plt.gca()
        iax.set_aspect("equal")
        iax.set_xlim([-1, 1])
        iax.set_ylim([-1, 1])
        fragments = [np.arange(10), np.arange(10, 20)]
        _, _, plattrb = circle_plot_residues(fragments,
                                             iax=iax,
                                             padding=[0, 0, 0])

        _utils.add_fragment_labels(fragments, ["frag_10_20", "frag_30_40"],
                                   iax,
                                   r=plattrb["r"])
        ifig = plt.gcf()
        ifig.tight_layout()
        # plt.savefig('test.png',bbox_inches="tight")
        plt.close("all")
Example #7
0
 def test_works_w_options(self):
     iax, xy, cpr_dict = circle_plot_residues([np.arange(50),
                                               np.arange(50, 100)],
                                              )
     _utils.add_aura(xy, np.mod(np.arange(len(xy)), 3), iax, r=cpr_dict["r"],
                     lines=False)