Skip to content
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

Replace relative imports by absolute ones in sage.{matrix,matroids,modules,stats} #36594

Merged
merged 3 commits into from
Nov 5, 2023

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Oct 30, 2023

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • 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 accordingly.

⌛ Dependencies

@mkoeppe mkoeppe force-pushed the absolute_cimport_sage_matrix branch from f1bd536 to 4370ea2 Compare October 31, 2023 01:07
@github-actions
Copy link

Documentation preview for this PR (built with commit 4370ea2; changes) is ready! 🎉

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 31, 2023

The pyright error is unrelated. Ready for review

@mkoeppe mkoeppe requested a review from dcoudert October 31, 2023 16:35
Copy link
Contributor

@dcoudert dcoudert left a comment

Choose a reason for hiding this comment

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

otherwise LGTM and passes tests on Fedora 35.

@@ -99,7 +99,7 @@ from sage.arith.numerical_approx cimport digits_to_bits
from copy import copy

import sage.modules.free_module
from . import berlekamp_massey
Copy link
Contributor

Choose a reason for hiding this comment

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

here we used from . import berlekamp_massey to import a module and it is replaced by from sage.matrix import berlekamp_massey. But in other places, for instance in src/sage/matroids/unpickling.pyx, we use import sage.matroids.matroid (not modified). I'm not sure of the difference between both forms. Which one is the most suited ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After from sage.matrix import berlekamp_massey, the module can be referred to as berlekamp_massey. This style tends to appear in older portions of the Sage source code. Personally I don't like it very much, but I have not made an effort to change it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see.

Copy link
Contributor

@dcoudert dcoudert left a comment

Choose a reason for hiding this comment

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

LGTM.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 31, 2023

Thank you!

vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 1, 2023
…{matrix,matroids,modules,stats}`

    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
- Cherry-picked from sagemath#35095
- This is for sagemath#36228
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] 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 accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36594
Reported by: Matthias Köppe
Reviewer(s): David Coudert, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 2, 2023
…{matrix,matroids,modules,stats}`

    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
- Cherry-picked from sagemath#35095
- This is for sagemath#36228
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] 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 accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36594
Reported by: Matthias Köppe
Reviewer(s): David Coudert, Matthias Köppe
@vbraun vbraun merged commit 8b52cc3 into sagemath:develop Nov 5, 2023
15 of 21 checks passed
@mkoeppe mkoeppe added this to the sage-10.2 milestone Nov 5, 2023
@mkoeppe mkoeppe deleted the absolute_cimport_sage_matrix branch December 23, 2023 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants