#10227: change_labels for sum species structure does not actually change the 
labels
-------------------------------------+-------------------------------------
       Reporter:  mhansen            |        Owner:  hivert
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-7.0
      Component:  combinatorics      |   Resolution:
       Keywords:  species            |    Merged in:
        Authors:  Mike Hansen        |    Reviewers:  Florent Hivert
Report Upstream:  N/A                |  Work issues:
         Branch:  u/chapoton/10227   |       Commit:
   Dependencies:  #5457, #5512,      |  d1d5103607927e9cc9294368075ea6d2fc3fad53
  #13317                             |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by mantepse):

 Looks OK.  It might make sense to add a docstring to {{{change_labels}}}
 in
 {{{
 composition_species.py:69:    def change_labels(self, labels):
 partition_species.py:112:    def change_labels(self, labels):
 product_species.py:119:    def change_labels(self, labels):
 structure.py:125:    def change_labels(self, labels):
 structure.py:267:    def change_labels(self, labels):
 }}}

 I suggest:

 {{{
 Returns a relabelled structure.

 INPUT:

 - ``labels``, a list of labels.

 OUTPUT:

 A structure with the i-th label of self replaced with the i-th label of
 the list.

 EXAMPLES::

     sage: C = species.CycleSpecies(3)
     sage: ls1 = C.structures([1,2,3]); ls2 = C.structures(["a", "b", "c"])
     sage: s = s1[0].change_labels(["b", "c", "a"]); t = s2[0]; (s,t,s==t)
     (('b', 'c', 'a'), ('a', 'b', 'c'), False)
     sage: s = s1[0].change_labels(["a", "b", "c"]); t = s2[0]; (s,t,s==t)
     (('a', 'b', 'c'), ('a', 'b', 'c'), True)


 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/10227#comment:21>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to