-
-
Notifications
You must be signed in to change notification settings - Fork 570
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
Remove CombinatorialClass from Permutations #14772
Comments
comment:1
Minor dependency on #8386 due to use of |
Dependencies: #8386 |
comment:2
Let's try it with #14519 as a dependency. |
comment:3
Looks good to me. The main issue is that there are two classcall_private methods with out tests; however, they are tested in the the doctest for init. I don't think it makes sense to duplicate the tests. Maybe just a note that it is tested via the init doctests? |
comment:4
I added some (simple) doctests to the |
comment:7
All doctest errors should be fixed now. |
comment:9
I put this over #14808, so I'm putting that as a dependency now. |
comment:10
It'll probably need some rebase, though. |
comment:11
I already had #14808 applied in the combinat queue, so it shouldn't need rebasing. |
comment:12
OOPS, you're right. Sorry; I had an obsolete patch in my .hg/patches folder. |
comment:13
But the |
comment:14
@@ -1542,10 +1561,10 @@ class Permutation_class(CombinatorialObj
def number_of_inversions(self):
r"""
- Returns the number of inversions in the permutation p.
-
- An inversion of a permutation is a pair of elements (p[i],p[j])
- with i < j and p[i] > p[j].
+ Return the number of inversions in ``self``.
+
+ An inversion of a permutation is a pair of elements `(p_i,p_j)`
+ with `i < j` and `p_i > p_j`.
REFERENCES:
|
comment:15
I wasn't speaking about the syntax. It should say "a pair of elements |
comment:16
Ah. Fixed. I also added some latex options for permutations and being able to display them as words (which is how I generally look at them, transpositions on positions). I made some other minor changes to other docstrings I noticed, so I apologize in advance if you have to rebase. |
comment:17
With the following patches applied on
I cannot reproduce the doctest failure from the patchbot
Only #12250 and #14476 do not have a positive review and this commutes with those patches. So I don't know why that doctest is failing for the patchbot... |
comment:18
Looks like MRO. The class Arrangements inherits from Permutations. Permutations of a multiset have their own cardinality() method, which gives the (wrong) 1260 answer in this case. The correct 22 answer is obtained by the standard cardinality() method of FiniteEnumeratedSets (?) which just takes the length of the list(). |
comment:19
Strange that it wasn't showing up when I was running my doctests (although it did appear when I did it in sage). Typically I get the other behavior. Fixed. Thank Darij. |
comment:20
Mike, do you think you could do a re-review of this patch? Thanks. |
comment:21
Darij, since Mike hasn't responding, do you think you could do the final review of this patch? Thanks. |
comment:22
I've started the review -- but I'm stuck at
But when I try to run them ingame, they don't behave that nicely:
I have a feeling that they are not recognized as doctests due to the weird place they're in... And I don't know what to do about this. |
comment:23
Ack...I forgot to check the global options tests. That syntax is from the old sytle, it should be You're also correct in that the doctest framework does not pick up dynamically created docstrings (unfortunately). Thanks, Travis |
Changed reviewer from Mike Hansen, Darij Grinberg to Mike Hansen, Darij Grinberg, Jeff Ferreira |
comment:57
Fixed. I think I removed a test from the options after I did a check on the sources. Thanks for catching that.
For patchbot: Apply: trac_14772-remove_cc_permutations-ts.patch |
Attachment: trac_14772-remove_cc_permutations-ts.patch.gz |
comment:58
Trivial rebase over #14863. For patchbot: Apply: trac_14772-remove_cc_permutations-ts.patch |
comment:59
There is something wrong ! Before applying this patch:
After applying this patch:
How can that be an error (and what does that error message tell me)? |
comment:60
Weird, because I'm not getting this error. Can you quote the whole traceback maybe? |
comment:61
I'm glad that this is not intentional. I was worried that this patch made more significant changes to the use of the
|
comment:62
I think this is because you don't have #14519 applied. Is that so? |
comment:63
Yes. That was missing and it seems to work fine. This was my fault. Thanks for helping. |
Merged: sage-5.12.beta3 |
Part of #12913.
Apply: attachment: trac_14772-remove_cc_permutations-ts.patch
Depends on #8386
Depends on #14519
Depends on #14808
Depends on #14143
Depends on #14015
Depends on #14516
Depends on #14863
CC: @sagetrac-sage-combinat @zabrocki @sagetrac-alubovsky @nthiery
Component: combinatorics
Keywords: days49
Author: Travis Scrimshaw
Reviewer: Mike Hansen, Darij Grinberg, Jeff Ferreira
Merged: sage-5.12.beta3
Issue created by migration from https://trac.sagemath.org/ticket/14772
The text was updated successfully, but these errors were encountered: