Skip to content

Commit c1a0323

Browse files
author
Release Manager
committed
gh-35230: `sage.rings.function_field`: Modularization fixes <!-- ^^^^^ 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 - We split out `.derivations` (which uses modules) from `.maps` (which doesn't). - We separate the implementation of rational function fields (which do not need Singular for Gröbner basis calculations) from the implementation of more complicated function fields (which do). - We move some imports into methods. This is for modularization purposes: - Part of #29705 <!-- Describe your changes here in detail --> <!-- 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" --> ### 📝 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: ... --> - Depends on #35237 (for the feature `sage.libs.singular`) - Depends on #35119 (to preempt merge conflicts) URL: #35230 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee, Matthias Köppe
2 parents 3b8f20e + db2f8dd commit c1a0323

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+13401
-12509
lines changed

src/doc/en/developer/packaging_sage_library.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,15 @@ doctests that depend on :class:`sage.symbolic.ring.SymbolicRing` for integration
567567
testing. Hence, these doctests are marked ``# optional -
568568
sage.symbolic``.
569569

570+
When defining new features for the purpose of doctest annotations, it may be a good
571+
idea to hide implementation details from feature names. For example, all doctests that
572+
use finite fields have to depend on PARI. However, we have defined a feature
573+
:mod:`sage.rings.finite_rings` (which implies the presence of :mod:`sage.libs.pari`).
574+
Annotating the doctests ``# optional - sage.rings.finite_rings`` expresses the
575+
dependency in a clearer way than using ``# optional - sage.libs.pari``, and it
576+
will be a smaller maintenance burden when implementation details change.
577+
578+
570579
Testing the distribution in virtual environments with tox
571580
---------------------------------------------------------
572581

src/doc/en/reference/function_fields/index.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,27 @@ algebraic closure of `\QQ`.
1111
:maxdepth: 1
1212

1313
sage/rings/function_field/function_field
14+
sage/rings/function_field/function_field_rational
15+
sage/rings/function_field/function_field_polymod
1416
sage/rings/function_field/element
17+
sage/rings/function_field/element_rational
18+
sage/rings/function_field/element_polymod
1519
sage/rings/function_field/order
20+
sage/rings/function_field/order_rational
21+
sage/rings/function_field/order_basis
22+
sage/rings/function_field/order_polymod
1623
sage/rings/function_field/ideal
24+
sage/rings/function_field/ideal_rational
25+
sage/rings/function_field/ideal_polymod
1726
sage/rings/function_field/place
27+
sage/rings/function_field/place_rational
28+
sage/rings/function_field/place_polymod
1829
sage/rings/function_field/divisor
1930
sage/rings/function_field/differential
2031
sage/rings/function_field/valuation_ring
32+
sage/rings/function_field/derivations
33+
sage/rings/function_field/derivations_rational
34+
sage/rings/function_field/derivations_polymod
2135
sage/rings/function_field/maps
2236
sage/rings/function_field/extensions
2337
sage/rings/function_field/constructor

src/doc/en/reference/valuations/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ More Details
201201
sage/rings/valuation/mapped_valuation
202202
sage/rings/valuation/scaled_valuation
203203

204-
sage/rings/function_field/function_field_valuation
204+
sage/rings/function_field/valuation
205205
sage/rings/padics/padic_valuation
206206

207207
.. include:: ../footer.txt

src/sage/categories/function_fields.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ def _call_(self, x):
5252
EXAMPLES::
5353
5454
sage: C = FunctionFields()
55-
sage: K.<x>=FunctionField(QQ)
55+
sage: K.<x> = FunctionField(QQ)
5656
sage: C(K)
5757
Rational function field in x over Rational Field
5858
sage: Ky.<y> = K[]
59-
sage: L = K.extension(y^2-x)
60-
sage: C(L)
59+
sage: L = K.extension(y^2 - x) # optional - sage.rings.function_field
60+
sage: C(L) # optional - sage.rings.function_field
6161
Function field in y defined by y^2 - x
62-
sage: C(L.equation_order())
62+
sage: C(L.equation_order()) # optional - sage.rings.function_field
6363
Function field in y defined by y^2 - x
6464
"""
6565
try:

src/sage/features/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,19 @@
5252
As can be seen above, features try to produce helpful error messages.
5353
"""
5454

55+
# *****************************************************************************
56+
# Copyright (C) 2016 Julian Rüth
57+
# 2018 Jeroen Demeyer
58+
# 2018 Timo Kaufmann
59+
# 2019-2022 Matthias Koeppe
60+
# 2021 Kwankyu Lee
61+
#
62+
# Distributed under the terms of the GNU General Public License (GPL)
63+
# as published by the Free Software Foundation; either version 2 of
64+
# the License, or (at your option) any later version.
65+
# https://www.gnu.org/licenses/
66+
# *****************************************************************************
67+
5568
from __future__ import annotations
5669

5770
import os

src/sage/features/all.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
Enumeration of all defined features
33
"""
44

5+
# *****************************************************************************
6+
# Copyright (C) 2021 Matthias Koeppe
7+
#
8+
# Distributed under the terms of the GNU General Public License (GPL)
9+
# as published by the Free Software Foundation; either version 2 of
10+
# the License, or (at your option) any later version.
11+
# https://www.gnu.org/licenses/
12+
# *****************************************************************************
13+
514
def all_features():
615
r"""
716
Return an iterable of all features.

src/sage/features/bliss.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
# -*- coding: utf-8 -*-
21
r"""
32
Features for testing the presence of ``bliss``
43
"""
4+
5+
# *****************************************************************************
6+
# Copyright (C) 2016 Julian Rüth
7+
# 2018 Jeroen Demeyer
8+
# 2021 Matthias Koeppe
9+
#
10+
# Distributed under the terms of the GNU General Public License (GPL)
11+
# as published by the Free Software Foundation; either version 2 of
12+
# the License, or (at your option) any later version.
13+
# https://www.gnu.org/licenses/
14+
# *****************************************************************************
15+
516
from . import CythonFeature, PythonModule
617
from .join_feature import JoinFeature
718

src/sage/features/cddlib.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
r"""
22
Feature for testing the presence of ``cddlib``
33
"""
4+
5+
# *****************************************************************************
6+
# Copyright (C) 2022 Matthias Koeppe
7+
#
8+
# Distributed under the terms of the GNU General Public License (GPL)
9+
# as published by the Free Software Foundation; either version 2 of
10+
# the License, or (at your option) any later version.
11+
# https://www.gnu.org/licenses/
12+
# *****************************************************************************
13+
414
from . import Executable
515

616

src/sage/features/csdp.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
Feature for testing the presence of ``csdp``
44
"""
55

6+
# *****************************************************************************
7+
# Copyright (C) 2016 Julian Rüth
8+
# 2018 Jeroen Demeyer
9+
# 2019 David Coudert
10+
# 2021 Matthias Koeppe
11+
#
12+
# Distributed under the terms of the GNU General Public License (GPL)
13+
# as published by the Free Software Foundation; either version 2 of
14+
# the License, or (at your option) any later version.
15+
# https://www.gnu.org/licenses/
16+
# *****************************************************************************
17+
618
import os
719
import re
820
import subprocess

src/sage/features/cython.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
# -*- coding: utf-8 -*-
21
r"""
32
Features for testing the presence of ``cython``
43
"""
54

5+
# *****************************************************************************
6+
# Copyright (C) 2021 Matthias Koeppe
7+
#
8+
# Distributed under the terms of the GNU General Public License (GPL)
9+
# as published by the Free Software Foundation; either version 2 of
10+
# the License, or (at your option) any later version.
11+
# https://www.gnu.org/licenses/
12+
# *****************************************************************************
13+
614
from . import CythonFeature
715

816

0 commit comments

Comments
 (0)