Skip to content

Changed gens to tuple in AbstractLinearCodeNoMetric, mwrank_EllipticCurve, and FiniteSubgroup. #39660

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

Merged
merged 7 commits into from
Apr 29, 2025

Conversation

Noel-Roemmele
Copy link
Contributor

Pull request for part of the issue described in #34120. Changes the gens in AbstractLinearCodeNoMetric, mwrank_EllipticCurve, and FiniteSubgroup to produce tuples.

Possible Issues: In mwrank_EllipticCurve should the gens be a tuple of lists or a tuple of tuples? The generators are points so I'm leaning towards tuple of list but I wanted to make sure. Then for FiniteSubgroup is there any
difference between an immutable sequence and a tuple?

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Copy link

github-actions bot commented Mar 10, 2025

Documentation preview for this PR (built with commit b90f0bb; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

Copy link
Member

@dimpase dimpase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @DaveWitteMorris - OK? Please turn in to Positive Review

@DaveWitteMorris
Copy link
Member

@dimpase: Should sage-devel be asked whether it is okay to change the gens of sage.modular.abvar.finite_subgroup.FiniteSubgroup from (immutable) Sequence to tuple? I'm worried that there might have been a reason to use Sequence, so the change might break some code. Although the output type is not stated in the docstring, it is in the type annotation. (Or maybe delay this one change to early in the next release cycle, so it gets tested?)

Also, two minor edits:

line 379 of src/sage/coding/linear_code_no_metric.py
- Return the generators of this code as a list of vectors.
+ Return the generators of this code as a tuple of vectors.

line 574 of src/sage/libs/eclib/interface.py
- Return a list of the generators for the Mordell-Weil group.
+ Return a tuple of the generators for the Mordell-Weil group.

@Noel-Roemmele
Copy link
Contributor Author

@DaveWitteMorris Looking at the Sequence example again it does look like it's turning a the list B into an immutable sequence. So the only difference between Sequence and tuple would be if Sequence has more functionality than tuple.

@Noel-Roemmele
Copy link
Contributor Author

@DaveWitteMorris I've change the documentation of gens in AbstractLinearCodeNoMetric, mwrank_EllipticCurve, and FiniteSubgroup to reference that they are returning tuples not lists.

@Noel-Roemmele
Copy link
Contributor Author

@DaveWitteMorris If you could take a look at this PR again and see if it is ready to be set to positive review that would be great! I think we we're discussing if a tuple is equivalent to an immutable sequence.

@DaveWitteMorris
Copy link
Member

I ran make ptestlong to confirm that the doctest errors are not coming from this PR.

@vbraun vbraun merged commit c597287 into sagemath:develop Apr 29, 2025
17 of 20 checks passed
@Noel-Roemmele Noel-Roemmele deleted the 34120GensTupleBatch1 branch May 2, 2025 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants