-
-
Notifications
You must be signed in to change notification settings - Fork 696
fix: accept both 'impl' and 'implementation' parameters for GF() #41123
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
Conversation
|
Looks good at first glance. I'll take a more careful look after the CI runs. @sagemath/core can someone approve the CI run? |
|
Documentation preview for this PR (built with commit 8b654d0; changes) is ready! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
CI looks good other than the linter error, make sure you fix that. This approach looks good, but I'd like you to clean it up just a little bit more. Specifically, #40806 says that we should prefer implementation and eventually deprecate impl. Deprecating impl is out of scope for this PR and requires further discussion. But we should definitely prefer implementation over impl, and the documentation and function signatures should reflect that.
To that effect, can you make these changes:
- Change the
implkeyword argument in the relevant methods toimplementation, and getimplfrom**kwdsinstead of the other way around. - Reword the documentation to make it clear that
implementationis preferred, but thatimplis supported for backwards compatibility. - Change any examples in the docstrings that use
implto useimplementation. I don't expect you to comb through our entire codebase for this, but do it for the docstrings of any methods you're modifying anyway. - As mentioned above, fix the lint error. Since you're a first-time contributor GitHub permissions make running the CI kind of annoying. To speed things up, please run at least the
rufflinter locally and make sure our requires rules are passing on any files you've changed before pushing your changes (see https://doc.sagemath.org/html/en/developer/tools.html for how to runrufflocally) - (Optional) For any methods where you change the method signature, add type annotations where possible. We're slowly working on adding more type annotations to Sage, and if you're modifying a line might as well add type annotations while you're at it. This should be fairly easy for
boolandstrarguments, integer arguments are weird because Sage has two integer types so don't worry about those for now.
Also might as well merge the latest develop while you're at it.
|
Tagging @user202729 who opened #40806 in case they have anything else to add. |
|
@vincentmacri |
|
Can you check the merge history of the branch? github reports 164 commits on this branch, with many changes that are unrelated to what the ticket is about. One commit showing is, for instance: Updated SageMath version to 10.8.beta9. in sagemath:develop there is a corresponding commit (with the same hash!): Normally such commits should not be reported, since the comparison is made against sagemath:develop. I suspect updates were merged in the wrong way. It might be good to go back to a cleaner point in your branch and redo the merge of develop into it. You'd then have to force-push the resulting branch to this pull-request. Hopefully you'll get a cleaner history that way. I'm only noticing the problem and don't have much experience with fixing this kind of thing. Advice from a git expert most welcome. |
9f57b85 to
5c8d9e9
Compare
|
sorry i am new to open source , please review this now i think i did another mistake while merging . |
|
your branch should be based on the current beta. Assuming you are on the current PR branch: |
GF: Accept both
implandimplementationparametersFixes #40806
📝 Description
This PR fixes an inconsistency in the
GF()constructor whereGF(25, impl='givaro')was accepted butGF(25, implementation='givaro')raised an error or was silently ignored.The Problem
The
GF()function internally used the parameter nameimplbut users naturally expected the more descriptiveimplementationto work. Whenimplementationwas used, it was either ignored or caused an error, leading to confusion.The Solution
create_key_and_extra_args()to accept bothimplandimplementationparametersimplementationto the internalimplvariable📝 Checklist