-
-
Notifications
You must be signed in to change notification settings - Fork 479
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
sage.{modular,schemes}
: Modularization fixes for imports; update sage -fiximports
, add relint pattern
#35884
sage.{modular,schemes}
: Modularization fixes for imports; update sage -fiximports
, add relint pattern
#35884
Conversation
sage.modular
: Modularization fixes for imports; update sage -fiximports
, add relint pattern sage.{modular,schemes}
: Modularization fixes for imports; update sage -fiximports
, add relint pattern
SageMath version 10.1.beta7, Release Date: 2023-07-20
The Linter failure is unrelated and fixed in #35974 |
@@ -61,7 +61,7 @@ | |||
# https://www.gnu.org/licenses/ | |||
###################################################################### | |||
|
|||
import sage.matrix.all as matrix | |||
from sage.matrix.constructor import Matrix as matrix | |||
import sage.schemes.hyperelliptic_curves.monsky_washnitzer |
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.
why not just from sage.matrix.constructor import matrix
?
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.
OK, done (in all places)
from sage.rings.padics.precision_error import PrecisionError | ||
from sage.rings.power_series_ring import PowerSeriesRing | ||
from sage.rings.rational_field import QQ | ||
from sage.structure.sage_object import SageObject | ||
|
||
lazy_import('sage.rings.padics.factory', 'Qp', as_='pAdicField') | ||
|
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.
Why only this is lazy-imported while PrecisionError
from sage.rings.padics.precision_error
is just imported?
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.
sage.rings.padics.precision_error is shipped by sagemath-categories
One cannot do try: ... except ... with a LazyImport
Yes, that's |
Yes, that's for sure one of the tests to run, but sometimes one also may want to test with extras added to enable more tests.
Right. |
Yes, that's a great point. While #35749 is adding a detailed description of how to test in a modularized setting, something has yet to be added to the tutorials that describe the development workflow.
There is certainly a potential for developer frustration after we make failures of the modularized distributions hard errors. This is something to watch out for and mitigate. |
Certainly adding those annotations is a huge task and error-prone, and it is good that there is a one source of truth. That one source of truth should be Hence it would be nice that we can add the annotations automatically from the manifest files, perhaps as part of the bootstrap. I asked chatGPT how to do that. It answered
But this does not work with me. Its second answer is
This seems to work. I ran the command in Does this make sense? |
Right now, this is true to some extent, but it's a bit more complicated actually. Some of the I'm hoping to unify and simplify this soon; not sure if I really want to keep the MANIFEST mechanism.
This can't be part of the bootstrap because it would need to modify source files that are under version control. But it would be indeed be very useful as a developer tool when making changes to the contents of the distributions. I'm currently doing this with very primitive tools. |
A better command is |
We may use MANIFEST (or something renamed) as a tool to mass-add the file annotations, but use the file annotations as the one source of truth. From developer's point of view, I think both mechanisms would be useful. |
|
||
import sage.rings.all | ||
from sage.modules.free_module import FreeModule, is_FreeModule | ||
from sage.rings.integer import Integer | ||
|
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.
Couldn't we get rid of is_FreeModule
on the way?
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.
Perhaps not in this PR...
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.
Right, separate PR
Please soothe the linter. Otherwise, looks good to me. |
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.
Thanks.
Thank you! |
|
SageMath version 10.1.beta8, Release Date: 2023-07-30
SageMath version 10.1.beta9, Release Date: 2023-08-05
Documentation preview for this PR (built with commit bcd1d6e; changes) is ready! 🎉 |
…imports; update `sage -fiximports`, add relint pattern <!-- Please provide a concise, informative and self-explanatory title. --> <!-- Don't put issue numbers in the title. Put it in the Description below. --> <!-- For example, instead of "Fixes sagemath#12345", use "Add a new method to multiply two integers" --> ### 📚 Description <!-- 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". --> - Part of: sagemath#29705 - Cherry-picked from: sagemath#35095 <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x ]`. --> - [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: ... --> - Depends on sagemath#35974 (to soothe the linter) <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#35884 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee, Matthias Köppe
<!-- ^^^^^ 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 --> This is a new maintenance command for adding/updating `# sage_setup: distribution` directives at the top of source files. Based on a discussion in sagemath#35884 (comment) <!-- 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". --> - Part of: sagemath#29705 - Cherry-picked from: sagemath#35095 <!-- 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. - [x] 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: ... --> - Depends on sagemath#36533 (CI fix) <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36135 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee, Matthias Köppe
<!-- ^^^^^ 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 --> This is a new maintenance command for adding/updating `# sage_setup: distribution` directives at the top of source files. Based on a discussion in sagemath#35884 (comment) <!-- 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". --> - Part of: sagemath#29705 - Cherry-picked from: sagemath#35095 <!-- 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. - [x] 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: ... --> - Depends on sagemath#36533 (CI fix) <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36135 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee, Matthias Köppe
📚 Description
📝 Checklist
⌛ Dependencies
src/sage/schemes/projective/proj_bdd_height.py
: Fix markup #35974 (to soothe the linter)