-
-
Notifications
You must be signed in to change notification settings - Fork 561
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.rings.function_field
: Modularization fixes
#35230
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #35230 +/- ##
===========================================
- Coverage 88.62% 88.56% -0.07%
===========================================
Files 2148 2161 +13
Lines 398653 398744 +91
===========================================
- Hits 353308 353129 -179
- Misses 45345 45615 +270
... and 23 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. |
This PR makes me think whether the direction and the level of the modularization efforts is reasonable. The branch adds one of If the function fields module is dependent on all of these So a basic question is whether some users of the function fields module will need only, say, finite fields as their base fields and want to install only If we can still choose the level of the whole modularization efforts, I think we need to decide this on sage-devel, once and for all, before proceeding. |
No, that's not true. The basic rings ZZ and QQ are always available. |
Ah, I see. If the function field is an extension of rational function field over |
Yes, these dependencies are not always obvious. To some extent these optional tags provide the necessary information for users who need to deploy the modularized distributions. |
For modules where all doctests depend on a feature, I have been using the file-level annotation. |
All function fields, which are not simple rational function fields, use multivariate polynomial rings, which is provided by Singular. For a user of the function fields module, Singular is a prerequisite, not an additional feature. |
That's true, currently; but soon we will be able to provide multivariate polynomials using FLINT instead. |
Then those |
Yes, when the underlying library for a functionality changes, some of these annotations will need updating. Currently for example, the tag On the other hand, a tag like |
Back to my main point: We can just make the distribution package that installs the function fields module dependent on those technical features. Why not? The same question will be raised for every high level mathematical module when most of its doctests would be laced with lots of repetitive |
Because the ordinary rational functions also go through the same code, and they are a crucial part of setting up the categories for the basic rings. |
In some cases, after a mild reorganization it may be possible to replace lots of |
It would be possible to separate rational functions code from the extensions (of rational function fields) code. Then rational functions module could be included in a small distribution, and the extensions module would go into a bigger distribution. |
I added missing titles to new files in the PR to your branch |
Add missing titles to new files
Documentation preview for this PR is ready! 🎉 |
Nice. Thanks. |
Thank you! |
merge conflict |
SageMath version 10.0.beta6, Release Date: 2023-03-26
Trivial merge, back to positive |
|
gh-35314: `sage.schemes`: Reformat doctests, add `# optional` annotations <!-- ^^^^^ 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 --> Adding doctest tags `# optional - sage.rings.finite_rings`, `...number_field`, `...padics`. While going through the doctests line by line, I also made the following changes: - some coding style fixes in the doctests (such as adding spaces around some operators and after commas, following PEP 8) - improved the readability of them in the HTML format by breaking long lines to avoid having to scroll horizontally - improved indentation of input and output, in particular when morphisms are displayed - made better use of the horizontal space in the doctests of some modules in `sage.schemes.toric`, which were formatted for a very narrow layout - improved the sphinx markup of some docstrings. <!-- Why is this change required? What problem does it solve? --> The doctest tags are preparation for being able to test parts of `sage.schemes` in a modularized setting, in which not all rings are available. See https://doc.sagemath.org/html/en/developer/packaging_sage _library.html#doctest-only-dependencies <!-- If it resolves an open issue, please link to the issue here. For example "Closes #1337" --> 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. - [x] 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: ... --> - Depends on #35230 (not merged here) for the definition of the feature `sage.rings.finite_rings`. The mass edits adding `# optional` tags were made using the following Emacs macro. ```elisp (defun sage-copy-optional-annotation () "In a 'sage: ' line of a docstring, copy '# optional' from a previous line and advance to the end of the next 'sage: ' line or to the end of the current docstring. If invoked elsewhere, just advance to the end of the next 'sage: ' line." (interactive) (if (save-excursion (beginning-of-line) (looking-at " *sage:")) (let ((tab-stop-list (list (save-excursion (previous-line) (end-of-line) (re-search-backward "# *optional.*$") (- (match-beginning 0) (save-excursion (beginning-of-line) (point))))))) (end-of-line) (just-one-space) (tab-to-tab-stop) (insert (match-string-no-properties 0)) (re-search-forward "sage: \\|\"\"\"") (end-of-line)) (re-search-forward "sage:") (end-of-line))) (with-eval-after-load "python-mode" (define-key python-mode-map (kbd "C-M-;") 'sage-copy-optional- annotation)) ``` URL: #35314 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee, Matthias Köppe
@kwankyu many of the copyright headers here now only mention you as the copyright holder. I think that's not accurate and all the authors of the files from which the code has been copied should be mentioned. |
Right. Sorry about that. I prepared a PR to fix the mistakes. |
Also apologies from me – apparently I didn't catch it when I reviewed @kwankyu's contributions to this PR |
📚 Description
.derivations
(which uses modules) from.maps
(which doesn't).This is for modularization purposes:
📝 Checklist
⌛ Dependencies
sage.features
: Addsage.libs.singular
, features for standard Python packages #35237 (for the featuresage.libs.singular
)is_FiniteField
etc., makesage.rings.finite_rings
a namespace package #35119 (to preempt merge conflicts)