Closed AndrewMathas closed 15 years ago
A few comments:
Patches should be included as attachments.
content is only well-defined if k appears exactly once in the tableau. How should it work for the following tableau?
sage: Tableau([[3,3],[3,3]])
[[3, 3], [3, 3]]
In case k does not appear in the tableau, perhaps it is better to raise an error?
Whatever is decided for 2, it should be documented. You can do this with an OUTPUT section.
Replying to @saliola:
- content is only well-defined if k appears exactly once in the tableau. How should it work for the following tableau?
sage: Tableau([[3,3],[3,3]]) [[3, 3], [3, 3]]
This is not exactly a tableau ! :-) I don't know if it's standard but there is a notion of content associated to semi-standard tableau.
In case k does not appear in the tableau, perhaps it is better to raise an error?
Whatever is decided for 2, it should be documented. You can do this with an OUTPUT section.
``n``
(raw sage code) instead of `n`
(latex code) or <n>
(no particular meaning in rest) see http://wiki.sagemath.org/combinat/HelpOnTheDocReplying to @hivert:
Replying to @saliola:
- content is only well-defined if k appears exactly once in the tableau. How should it work for the following tableau?
When pushing this patch I described it as a content function on standard tableau and then added it to the Tableau class...I'll move it into the StandardTableau class and then all will be well.
The obvious "generalization" of the definition to semistandard tableau is used in the literature but writing the corresponding function is slightly cumbersome because in the classical case you add up the contents of all of nodes labelled k whereas for the q-analogue you add up the q-contents. Perhaps the nicest solution is to define
def content(self, k, q=1):
...
I have never used contents for tableaux which are not (semi)standard.
- In case k does not appear in the tableau, perhaps it is better to raise an error?
OK
- Whatever is decided for 2, it should be documented. You can do this with an OUTPUT section.
- I think parameters should be written
``n``
(raw sage code) instead of`n`
(latex code) or<n>
(no particular meaning in rest) see http://wiki.sagemath.org/combinat/HelpOnTheDoc
Thanks.
One last question: is there an easy way to "update" the patch and push it back to the server? Or do I have to somehow delete this patch and then reapply?
Cheers, Andrew
Replying to @AndrewAtLarge:
Replying to @hivert:
Replying to @saliola:
- content is only well-defined if k appears exactly once in the tableau. How should it work for the following tableau?
When pushing this patch I described it as a content function on standard tableau and then added it to the Tableau class...I'll move it into the StandardTableau class and then all will be well.
One slight problem: there doesn't seem to be a StandardTableau or SemistandardTableau class, just a Tableau class. So you'll have to create it, which is not a big deal.
One last question: is there an easy way to "update" the patch and push it back to the server? Or do I have to somehow delete this patch and then reapply?
In you sage-combinat branch, you can type hg qpop tableau-content-5487-AM.patch
, which will unapply all the patches up until you get to your patch. (Or you might have to qpush instead of qpop above depending on where you are in the stack.) Then you do your modifications. To save your modifications into the top patch (in this case, tableau-content-5487-AM.patch), you do hg qrefresh
. To see which patch is at the top of your stack, use the command hg qtop
. Once you are done with your modifications, you proceed as normal. That is: change into the patches directory, commit, then push.
I have moved the function into the StandardTableaux_n class and fixed the doc string problems.
Dear Andrew,
Sorry for bothering you with this first simple patch but before giving a positive review I'd rather see the following first problem fixed. I leave these to you because I understand that you want test the patch workflow. If you want me to fix these please ask.
I agree with Franco's first message: I'd rather raise an error than return False silently. Those False
or None
tends to crawl into the programs and to eventually trigger an error at the wrong place. You can always catch the exception if you want. I think ValueError
is the correct exception (see the similar behavior for list below).
I case you don't know, in python, when you have a list l
the call l.index(k)
either returns the first position of k
if it is in the list or raise a
ValueError: list.index(x): x not in list
maybe it's worth using it ?
cheers,
Florent
Attachment: tableau-content-5487-AM.patch.gz
Dear Florent,
I have changed the function to use index() and added an exception. More importantly, I have also created a StandardTableau_class class and a StandardTableau() function for holding and creating standard tableau...previously I was confused and thought that the StandardTableaux class did this. I discovered my error when I tested the new version (which I confess I had previously just moved into StandardTableaux and not tested...I promise to test properly in future!).
Hopefully the new patch also removes my unintended change to kschur.py.
Regards, Andrew
Review patch
Attachment: tableau-content-5487-review-fh.patch.gz
I Added a review patch which:
add some more doctests
correct the ReST syntax for doctests
Specifies which exception is caught.
I'm giving the positive review though someone should probably reread my trivial review patch...
Michael: please tell me if I should not give the review and ask for a formal review of my patch.
Cheers,
Florent
Replying to @hivert:
I Added a review patch which:
Positive review on Andrew and Florent's patches.
Merged both patches in Sage 3.4.1.rc3.
Cheers,
Michael
Attachment: trac_5487_tableau-content-5487-AM.patch.gz
This is the same as the first patch, but instead of a diff it has been commited in Andrew's name
Andrew,
I attached trac_5487_tableau-content-5487-AM.patch which is your patch checked in in your name. You attached a diff, but when you used hg queues you to export the patch after committing so that you get credited properly.
Cheers,
Michael
Oops, reassign to 3.4.1 since it was merged in that timeframe.
Cheers,
Michael
Simple patch adding a content function for tableaux to tableau.py.
[Mostly just a test to see if I can push a patch to the combinat server.]
CC: @sagetrac-sage-combinat
Component: combinatorics
Keywords: tableaux content
Issue created by migration from https://trac.sagemath.org/ticket/5487