Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change_labels for sum species structure does not actually change the labels #10227

Closed
mwhansen opened this issue Nov 6, 2010 · 27 comments
Closed

Comments

@mwhansen
Copy link
Contributor

mwhansen commented Nov 6, 2010


sage: X = species.SingletonSpecies()
sage: X2 = X+X
sage: X2.structures([1]).list()
[1, 1]
sage: s = X2.structures([1]).list()[0]
sage: s.labels()
[1]
sage: s.change_labels(["a"])
1

CC: @sagetrac-sage-combinat @mantepse

Component: combinatorics

Keywords: species

Author: Mike Hansen

Branch/Commit: 5fda98d

Reviewer: Florent Hivert, Martin Rubey

Issue created by migration from https://trac.sagemath.org/ticket/10227

@mwhansen
Copy link
Contributor Author

Author: Mike Hansen

@mwhansen
Copy link
Contributor Author

comment:1

This patch does a couple of things:

  1. Fix the change_labels bug above.

  2. Add a left/right summand/factor method to sum and product species.

  3. Make the labels method return all of the labels rather than just the ones that appear. This is a backwards incompatible change, but I am pretty sure that there isn't really any code out there that depends on this.

  4. Add a labels_subset method to do what the old labels methods did for subsets.

  5. Add additional documentation to some of the classes.

@mwhansen mwhansen added this to the sage-4.6.2 milestone Nov 26, 2010
@jdemeyer jdemeyer modified the milestones: sage-4.6.2, sage-4.7 Feb 8, 2011
@hivert
Copy link

hivert commented Mar 9, 2012

Reviewer: Florent Hivert

@hivert
Copy link

hivert commented Mar 9, 2012

comment:3

I'm assigning the ticket to myself to remember to review it.

@hivert hivert assigned hivert and unassigned mwhansen Mar 9, 2012
@mwhansen
Copy link
Contributor Author

comment:4

Florent, if you have time, could you take a quick look at this. #5512 is waiting on it.5512 Thanks!

@mwhansen
Copy link
Contributor Author

Dependencies: #5512

@mwhansen
Copy link
Contributor Author

comment:5

I rebased trac_10227-species_fixes-mh.patch on #5512

Apply trac_10227-species_fixes-mh.patch

@mwhansen
Copy link
Contributor Author

mwhansen commented Aug 1, 2012

Changed dependencies from #5512 to #5512, #13317

@mwhansen
Copy link
Contributor Author

mwhansen commented Aug 1, 2012

comment:7

Attachment: trac_10227-species_fixes-mh.patch.gz

@mwhansen
Copy link
Contributor Author

mwhansen commented Aug 1, 2012

Changed dependencies from #5512, #13317 to #5457, #5512, #13317

@fchapoton
Copy link
Contributor

Changed keywords from none to species

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@fchapoton
Copy link
Contributor

Commit: 33131ae

@fchapoton
Copy link
Contributor

Branch: u/chapoton/10227

@fchapoton
Copy link
Contributor

New commits:

33131ae#10227: change_labels for sum species structure does not actually change the labels

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 17, 2014

Changed commit from 33131ae to 9382d6f

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 17, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

0581575Merge branch 'u/chapoton/10227' of ssh://trac.sagemath.org:22/sage into 10227
9382d6ftrac #10277 a few minor doc formatting

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@fchapoton fchapoton modified the milestones: sage-6.4, sage-6.9 Aug 9, 2015
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 30, 2015

Changed commit from 9382d6f to d1d5103

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 30, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

d1d5103Merge branch 'u/chapoton/10227' into 6.10.b2

@fchapoton fchapoton modified the milestones: sage-6.9, sage-6.10 Oct 30, 2015
@fchapoton fchapoton modified the milestones: sage-6.10, sage-7.0 Jan 6, 2016
@mantepse
Copy link
Contributor

mantepse commented Jan 8, 2016

comment:20

I'm now building this.

@mantepse
Copy link
Contributor

mantepse commented Jan 8, 2016

comment:21

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)


@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 8, 2016

Changed commit from d1d5103 to 5fda98d

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 8, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

8a9b25bMerge branch 'u/chapoton/10227' into 6.7.b3
5fda98dadding doc to change_labels methods

@mantepse
Copy link
Contributor

mantepse commented Jan 9, 2016

comment:23

(You didn't put my example into the doc for change_labels, but that's OK. It's purpose would have been to clarify equality of structures: one might think that (b, c, a) and (a, b, c) are the same cycle, but they are not. So it should actually be in the doc for equality)

Can I give this positive review? (Florent is in the reviewer list, not me)

@fchapoton
Copy link
Contributor

comment:24

Replying to @mantepse:

(You didn't put my example into the doc for change_labels, but that's OK. It's purpose would have been to clarify equality of structures: one might think that (b, c, a) and (a, b, c) are the same cycle, but they are not. So it should actually be in the doc for equality)

Where precisely do you want this example to be added ?

Can I give this positive review? (Florent is in the reviewer list, not me)

Yes, you can ; just add yourself to the reviewer list.

@mantepse
Copy link
Contributor

mantepse commented Jan 9, 2016

Changed reviewer from Florent Hivert to Florent Hivert, Martin Rubey

@vbraun
Copy link
Member

vbraun commented Jan 20, 2016

Changed dependencies from #5457, #5512, #13317 to none

@vbraun
Copy link
Member

vbraun commented Jan 23, 2016

Changed branch from u/chapoton/10227 to 5fda98d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants