Skip to content

Commit 8bcce63

Browse files
author
Release Manager
committed
gh-35305: `sage.quadratic_forms`: 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 We make `sage.quadratic_forms` ready for modularized distributions by: - moving imports from some packages, such as `sage.rings.padics.factory`, into methods - using `lazy_import` to provide the methods of `QuadraticForm` implemented in separate modules - adding `# optional` annotations to doctests Also some improvements to the code style of doctests and the Sphinx markup of some docstrings have been made. This has been and can be tested by merging into: - #35095 **sagemath-polyhedra** ships vector spaces etc. and now also portions of `sage.quadratic_forms` – see #35095 /files#diff- f4c7c1beea87ae44c426de0a55459daef63b75b701b72bc136d88f4e7c9285cfR104 Resolves #35243 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. - [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 #35248 - Depends on #35166 URL: #35305 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee, Matthias Köppe
2 parents 97b45d8 + a937a04 commit 8bcce63

Some content is hidden

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

44 files changed

+1994
-2131
lines changed

src/sage/dynamics/arithmetic_dynamics/berkovich_ds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ def __call__(self, x, type_3_pole_check=True):
926926
variable = nth_derivative.parent().gens()[0]
927927
a = x.center()[0]
928928
Taylor_expansion = []
929-
from sage.functions.other import factorial
929+
from sage.arith.misc import factorial
930930
for i in range(f.degree() + 1):
931931
Taylor_expansion.append(nth_derivative(a) * 1/factorial(i))
932932
nth_derivative = nth_derivative.derivative(variable)

src/sage/groups/misc_gps/argument_groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ def __pow__(self, exponent):
11921192
sage: a.parent()
11931193
Symbolic Ring
11941194
"""
1195-
from sage.symbolic.ring import SymbolicRing
1195+
from sage.rings.abc import SymbolicRing
11961196

11971197
element = self._element_ ** exponent
11981198
parent = element.parent()

src/sage/modular/arithgroup/congroup_gamma0.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,6 @@ def dimension_new_cusp_forms(self, k=2, p=0):
593593
sage: all(Gamma0(N).dimension_new_cusp_forms(2)==100 for N in L)
594594
True
595595
"""
596-
from sage.functions.other import floor
597-
598596
N = self.level()
599597
k = ZZ(k)
600598

@@ -669,8 +667,8 @@ def v3(q, a):
669667

670668
res = (k - 1) / 12 * N * prod(s0(q, a) for q, a in factors)
671669
res -= prod(vinf(q, a) for q, a in factors) / ZZ(2)
672-
res += ((1 - k)/4 + floor(k/4)) * prod(v2(q, a) for q, a in factors)
673-
res += ((1 - k)/3 + floor(k/3)) * prod(v3(q, a) for q, a in factors)
670+
res += ((1 - k)/4 + k//4) * prod(v2(q, a) for q, a in factors)
671+
res += ((1 - k)/3 + k//3) * prod(v3(q, a) for q, a in factors)
674672
if k == 2:
675673
res += moebius(N)
676674
return res

0 commit comments

Comments
 (0)