Ticket #13747: trac_13747_reviewer.patch

File trac_13747_reviewer.patch, 3.2 KB (added by novoselt, 8 years ago)
  • sage/geometry/cone.py

    # HG changeset patch
    # User Andrey Novoseltsev <novoselt@gmail.com>
    # Date 1354560727 25200
    # Node ID da8f050314de4704b25c92b5559feeae921e68df
    # Parent  4df414510d5d1293b58447f8fd2b6f147f1a0a8b
    Reviewer changes to poset changes in cones and fans.
    
    diff --git a/sage/geometry/cone.py b/sage/geometry/cone.py
    a b  
    18021802                    adjacent.update(L.open_interval(facet,  superface))
    18031803            if adjacent:
    18041804                adjacent.remove(L(self))
    1805             return self._sort_faces(iter(adjacent))
     1805            return self._sort_faces(adjacent)
    18061806        elif self.dim() == self._ambient.dim():
    18071807            # Special treatment relevant for fans
    18081808            for facet in facets:
     
    21032103             1-d face of 2-d cone in 2-d lattice N]
    21042104            [2-d cone in 2-d lattice N]
    21052105
    2106         Now you can look at the rays of this face... ::
     2106        For a particular face you can look at its actual rays... ::
    21072107
    21082108            sage: face = L.level_sets()[1][0]
    21092109            sage: face.rays()
    21102110            N(1, 0)
    21112111            in 2-d lattice N
    21122112
    2113         ... or you can see indices of the rays of the orginal cone that
    2114         correspond to the above ray::
     2113        ... or you can see the index of the ray of the original cone that
     2114        corresponds to the above one::
    21152115
    21162116            sage: face.ambient_ray_indices()
    21172117            (0,)
     
    24022402                    "dimension and codimension cannot be specified together!")
    24032403        dim = self.dim() - codim if codim is not None else dim
    24042404        if "_faces" not in self.__dict__:
    2405             self._faces = tuple(self._sort_faces(iter(level))
    2406                                 for level in self.face_lattice().level_sets())
     2405            self._faces = tuple(map(self._sort_faces,
     2406                                    self.face_lattice().level_sets()))
    24072407            # To avoid duplication and ensure order consistency
    24082408            if len(self._faces) > 1:
    24092409                self._facets = self._faces[-2]
     
    25692569        if "_facets" not in self.__dict__:
    25702570            L = self._ambient._face_lattice_function()
    25712571            H = L.hasse_diagram()
    2572             self._facets = self._sort_faces(tuple(H.neighbors_in(L(self))))
     2572            self._facets = self._sort_faces(H.neighbors_in(L(self)))
    25732573        return self._facets
    25742574
    25752575    def intersection(self, other):
  • sage/geometry/fan.py

    diff --git a/sage/geometry/fan.py b/sage/geometry/fan.py
    a b  
    19851985            (2-d cone of Rational polyhedral fan in 2-d lattice N,)
    19861986           
    19871987        You cannot specify both dimension and codimension, even if they
    1988         'agree'::
     1988        "agree"::
    19891989       
    19901990            sage: fan(dim=1, codim=1)
    19911991            Traceback (most recent call last):
     
    20032003            ()
    20042004        """
    20052005        if "_cones" not in self.__dict__:
    2006             levels = map(iter,self.cone_lattice().level_sets()) # generators
    2007 
     2006            levels = self.cone_lattice().level_sets()
    20082007            levels.pop() # The very last level is this FAN, not cone.
    20092008            # It seems that there is no reason to believe that the order of
    20102009            # faces in level sets has anything to do with the order of