-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Add get_part method to partition.py #11300
Comments
Attachment: trac_11300-get_part_partition-jb.patch.gz |
This comment has been minimized.
This comment has been minimized.
Author: jbandlow |
This comment has been minimized.
This comment has been minimized.
Reviewer: Florent Hivert |
Changed author from jbandlow to Jason Bandlow |
Changed keywords from partitions, sagedays30 to partitions, days30 |
comment:3
Looks good and is useful ! |
comment:4
The one issue with this is the following:
Is there a use case for a changeable default value? |
comment:5
Replying to @mwhansen:
That is a very good remark !
If yes this can be corrected by changing |
comment:6
I've changed the default value to Integer(0). I don't have a specific use case for another value, but it seems like it might come in handy. Do you have a reason you think it's a bad idea? I could probably be convinced to get rid of it. |
comment:7
Hello Jason. I'm curious: did you compare timings of using the try-except statement:
with an if statement, like this one:
I would guess that try-except statements are slower, but I have not tried it. |
comment:8
Attachment: trac_11300-get_part_partition-jb.2.patch.gz Replying to @saliola:
I tried it and you're right--'if' is significantly faster. I've replaced the patch. |
comment:9
Thanks for testing that. Positive review. |
This comment has been minimized.
This comment has been minimized.
Merged: sage-4.7.1.alpha1 |
Add a method to partitions to return a default value for parts that do not exist.
Apply: attachment: trac_11300-get_part_partition-jb.2.patch
CC: @sagetrac-sage-combinat
Component: combinatorics
Keywords: partitions, days30
Author: Jason Bandlow
Reviewer: Florent Hivert
Merged: sage-4.7.1.alpha1
Issue created by migration from https://trac.sagemath.org/ticket/11300
The text was updated successfully, but these errors were encountered: