Ticket #14640: trac_14640-refactor_plot_expose-review-ts.patch

File trac_14640-refactor_plot_expose-review-ts.patch, 5.8 KB (added by tscrim, 6 years ago)
  • sage/combinat/root_system/plot.py

    # HG changeset patch
    # User Travis Scrimshaw <tscrim@ucdavis.edur>
    # Date 1369717493 25200
    # Node ID 9cbc130a8ff64bdc7252528f1df0b71c33800b9c
    # Parent  7bd9302df611971e71fa7dfa4fa9498bc728f8e1
    #14640: review patch.
    
    diff --git a/sage/combinat/root_system/plot.py b/sage/combinat/root_system/plot.py
    a b class PlotOptions: 
    10891089
    10901090        TESTS::
    10911091
    1092             sage: H.describe()
     1092            sage: print H.description()
    10931093            Text '$H_{\alpha^\vee_{1}}$' at the point (0.0,3.15)
    10941094            Line defined by 2 points: [(0.0, 3.0), (0.0, -3.0)]
    10951095
  • sage/combinat/root_system/root_lattice_realizations.py

    diff --git a/sage/combinat/root_system/root_lattice_realizations.py b/sage/combinat/root_system/root_lattice_realizations.py
    a b class RootLatticeRealizations(Category_o 
    20042004            TESTS::
    20052005
    20062006                sage: L = RootSystem(["A",2]).ambient_space()
    2007                 sage: L.plot_reflection_hyperplanes().describe()
     2007                sage: print L.plot_reflection_hyperplanes().description()
    20082008                Text '$H_{\alpha^\vee_{1}}$' at the point (-1.81...,3.15)
    20092009                Text '$H_{\alpha^\vee_{2}}$' at the point (1.81...,3.15)
    20102010                Line defined by 2 points: [(-1.73..., 3.0), (1.73..., -3.0)]
    20112011                Line defined by 2 points: [(1.73..., 3.0), (-1.73..., -3.0)]
    20122012
    2013                 sage: L.plot_reflection_hyperplanes("all").describe()
     2013                sage: print L.plot_reflection_hyperplanes("all").description()
    20142014                Text '$H_{\alpha^\vee_{1} + \alpha^\vee_{2}}$' at the point (3.15,0.0)
    20152015                Text '$H_{\alpha^\vee_{1}}$' at the point (-1.81...,3.15)
    20162016                Text '$H_{\alpha^\vee_{2}}$' at the point (1.81...,3.15)
    class RootLatticeRealizations(Category_o 
    20192019                Line defined by 2 points: [(3.0, 0.0), (-3.0, 0.0)]
    20202020
    20212021                sage: L = RootSystem(["A",2,1]).ambient_space()
    2022                 sage: L.plot_reflection_hyperplanes().describe()
     2022                sage: print L.plot_reflection_hyperplanes().description()
    20232023                Text '$H_{\alpha^\vee_{0}}$' at the point (3.15,0.90...)
    20242024                Text '$H_{\alpha^\vee_{1}}$' at the point (-1.81...,3.15)
    20252025                Text '$H_{\alpha^\vee_{2}}$' at the point (1.81...,3.15)
    class RootLatticeRealizations(Category_o 
    20822082            TESTS::
    20832083
    20842084                sage: L = RootSystem(["B",2]).ambient_space()
    2085                 sage: L.plot_hedron().describe()
     2085                sage: print L.plot_hedron().description()
    20862086                Polygon defined by 8 points: [(1.5, 0.5), (0.5, 1.5), (-0.5, 1.5), (-1.5, 0.5), (-1.5, -0.5), (-0.5, -1.5), (0.5, -1.5), (1.5, -0.5)]
    20872087                Line defined by 2 points: [(-0.5, -1.5), (0.5, -1.5)]
    20882088                Line defined by 2 points: [(-0.5, 1.5), (0.5, 1.5)]
    class RootLatticeRealizations(Category_o 
    21402140            TESTS::
    21412141
    21422142                sage: L = RootSystem(["B",2,1]).ambient_space()
    2143                 sage: L.plot_fundamental_chamber().describe()
     2143                sage: print L.plot_fundamental_chamber().description()
    21442144                Polygon defined by 3 points:     [(0.5, 0.5), (1.0, 0.0), (0.0, 0.0)]
    21452145
    2146                 sage: L.plot_fundamental_chamber(style="classical").describe()
     2146                sage: print L.plot_fundamental_chamber(style="classical").description()
    21472147                Polygon defined by 3 points:     [(0.0, 0.0), (3.0, 3.0), (3.0, 0.0)]
    21482148            """
    21492149            plot_options = self.plot_parse_options(**options)
    class RootLatticeRealizations(Category_o 
    22042204            TESTS::
    22052205
    22062206                sage: L = RootSystem(["A",2,1]).weight_space()
    2207                 sage: L.plot_alcoves(alcoves=[[0,0]]).describe()
     2207                sage: print L.plot_alcoves(alcoves=[[0,0]]).description()
    22082208                Line defined by 2 points: [(-1.0, 0.0), (0.0, -1.0)]
    22092209                Line defined by 2 points: [(-1.0, 1.0), (-1.0, 0.0)]
    22102210                Line defined by 2 points: [(-1.0, 1.0), (0.0, 0.0)]
    class RootLatticeRealizations(Category_o 
    24262426                ...                          foldings = [False, False, True, False, False, False, True, False, True, False],
    24272427                ...                          color="green",
    24282428                ...                          start=L.rho())
    2429                 sage: p.describe()
     2429                sage: print p.description()
    24302430                Line defined by 2 points: [(-1.0, 8.0), (-1.5, 9.0)]
    24312431                Line defined by 2 points: [(1.0, 4.0), (1.5, 4.5)]
    24322432                Line defined by 2 points: [(1.0, 7.0), (1.5, 6.0)]
  • sage/plot/graphics.py

    diff --git a/sage/plot/graphics.py b/sage/plot/graphics.py
    a b class Graphics(SageObject): 
    26882688                figure.savefig(filename, dpi=dpi,
    26892689                           transparent=transparent)
    26902690
    2691     def describe(self):
     2691    def description(self):
    26922692        r"""
    26932693        Print a textual description to stdout.
    26942694
    class Graphics(SageObject): 
    26962696   
    26972697        EXAMPLES::
    26982698   
    2699             sage: polytopes.n_cube(2).plot().describe()
     2699            sage: print polytopes.n_cube(2).plot().description()
    27002700            Polygon defined by 4 points: [(1.0, 1.0), (-1.0, 1.0), (-1.0, -1.0), (1.0, -1.0)]
    27012701            Line defined by 2 points: [(-1.0, -1.0), (-1.0, 1.0)]
    27022702            Line defined by 2 points: [(-1.0, -1.0), (1.0, -1.0)]
    class Graphics(SageObject): 
    27132713                g_str = repr(g)
    27142714            data.append([g_zorder, g_str, g])
    27152715        data.sort()
    2716         for g in data:
    2717             print g[1]
    2718    
     2716        return '\n'.join(g[1] for g in data)
    27192717
    27202718class GraphicsArray(SageObject):
    27212719    """