Replace relative imports by absolute ones in sage.{matrix,matroids,modules,stats}#36594
Conversation
|
Documentation preview for this PR (built with commit 4370ea2; changes) is ready! 🎉 |
|
The pyright error is unrelated. Ready for review |
dcoudert
left a comment
There was a problem hiding this comment.
otherwise LGTM and passes tests on Fedora 35.
| from copy import copy | ||
|
|
||
| import sage.modules.free_module | ||
| from . import berlekamp_massey |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
|
Thank you! |
sagemathgh-36594: Replace relative imports by absolute ones in `sage.{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
sagemathgh-36594: Replace relative imports by absolute ones in `sage.{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
📝 Checklist
⌛ Dependencies