-
-
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
Drinfeld modules: Make some imports lazy #35275
Conversation
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 @mkoeppe for taking the initiative of writing the code, and requesting my review. I approve the changes, with only one minor suggestion.
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.
Looks perfect, thank you for making the change.
Thanks for reviewing! |
Documentation preview for this PR is ready! 🎉 |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #35275 +/- ##
===========================================
- Coverage 88.62% 88.61% -0.01%
===========================================
Files 2148 2148
Lines 398653 398655 +2
===========================================
- Hits 353308 353274 -34
- Misses 45345 45381 +36
... and 28 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
<!-- ^^^^^ 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 #1234" use "Introduce new method to calculate 1+1" --> ### 📚 Description <!-- Describe your changes here in detail --> We should be able to import Python modules from `sage.categories` even if implementation modules are not installed; that's the premise of the distribution **sagemath-categories**. Here we make changes to avoid module-level dependencies on some higher- level functionality, such as symbolic functions, linear algebra, etc. <!-- Why is this change required? What problem does it solve? --> <!-- If it resolves an open issue, please link to the issue here. For example "Closes #1337" --> #35275 takes care of some other imports. Part of - #29705 ### 📝 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! --> - [x] I have made sure that the title is self-explanatory and the description concisely explains the PR. - [ ] I have linked an issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open pull requests that this PR logically depends on --> <!-- - #xyz: short description why this is a dependency - #abc: ... --> URL: #35279 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
📚 Description
We replace some
import
s bylazy_imports
insage.categories.drinfeld_modules
and make the import ofDrinfeldModule
into the global namespace lazy. We also move the module-level import ofPolynomialBaseringInjection
insage.rings.polynomial.polynomial_ring
into a method.git grep '^from sage.rings' src/sage/categories
reveals that the recently added.drinfeld_modules
is the only module that imports nontrivial things fromsage.rings
. This is a new obstacle to modularization (it caused an error due to import cycles in #35095.)The purpose of reducing the module-level import to a method-level import is explained in https://doc.sagemath.org/html/en/developer/packaging_sage_library.html#module-level-runtime-dependencies
📝 Checklist
⌛ Dependencies