Drinfeld modules: Make some imports lazy#35275
Merged
vbraun merged 3 commits intosagemath:developfrom Apr 1, 2023
Merged
Conversation
kryzar
approved these changes
Mar 14, 2023
Contributor
kryzar
left a comment
There was a problem hiding this comment.
Looks perfect, thank you for making the change.
Contributor
Author
|
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. |
vbraun
pushed a commit
that referenced
this pull request
Apr 1, 2023
gh-35279: `sage.categories`: Modularization fixes for imports <!-- ^^^^^ 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📚 Description
We replace some
imports bylazy_importsinsage.categories.drinfeld_modulesand make the import ofDrinfeldModuleinto the global namespace lazy. We also move the module-level import ofPolynomialBaseringInjectioninsage.rings.polynomial.polynomial_ringinto a method.git grep '^from sage.rings' src/sage/categoriesreveals that the recently added.drinfeld_modulesis 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