-
-
Notifications
You must be signed in to change notification settings - Fork 516
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.padics
: Update # needs
#36259
Conversation
…t --distribution sagemath-ntl --distribution sagemath-pari --distribution sagemath-categories --only-tags --probe sage.rings.function_field src/sage/rings/padics src/sage/rings/valuation src/sage/rings/polynomial/padics
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.
I have not yet checked this giant PR line by line. At least it passes all tests.
I see the following warnings
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/function_field/function_field_rational.py
**********************************************************************
File "src/sage/rings/function_field/function_field_rational.py", line 140, in sage.rings.function_field.function_field_rational.RationalFunctionField.
__init__
Warning: Variable 'K' referenced here was set only in doctest marked '# needs sage.rings.real_mpfr'
TestSuite(K).run() # long time (5s)
[158 tests, 3.60 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/infinity.py
**********************************************************************
File "src/sage/rings/infinity.py", line 946, in sage.rings.infinity.UnsignedInfinity._sympy_
Warning: Consider using a block-scoped tag by inserting the line 'sage: # needs sympy' just before this line to avoid repeating the tag 4 times
import sympy # needs sympy
**********************************************************************
File "src/sage/rings/infinity.py", line 1629, in sage.rings.infinity.MinusInfinity._sympy_
Warning: Consider using a block-scoped tag by inserting the line 'sage: # needs sympy' just before this line to avoid repeating the tag 4 times
import sympy # needs sympy
[314 tests, 0.87 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/complex_double.pyx
**********************************************************************
File "src/sage/rings/complex_double.pyx", line 2554, in sage.rings.complex_double.ComplexToCDF
Warning: Consider using a block-scoped tag by inserting the line 'sage: # needs numpy' just before this line to avoid repeating the tag 4 times
import numpy # needs numpy
[338 tests, 0.21 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/function_field/function_field.py
**********************************************************************
File "src/sage/rings/function_field/function_field.py", line 128, in sage.rings.function_field.function_field
Warning: Variable 'K' referenced here was set only in doctest marked '# needs sage.rings.finite_rings'; '# needs sage.rings.function_field'; '# needs
sage.rings.function_field sage.rings.number_field'
TestSuite(K).run(max_runs=256) # long time (10s) # needs sage.rings.number_field
[293 tests, 64.57 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/integer.pyx
**********************************************************************
File "src/sage/rings/integer.pyx", line 3451, in sage.rings.integer.Integer.quo_rem
Warning: Consider using a block-scoped tag by inserting the line 'sage: # needs mpmath' just before this line to avoid repeating the tag 4 times
import mpmath # needs mpmath
**********************************************************************
File "src/sage/rings/integer.pyx", line 6233, in sage.rings.integer.Integer.__array_interface__
Warning: Variable 'numpy' referenced here was set only in doctest marked '# needs numpy'
numpy.array(2**40).dtype
**********************************************************************
File "src/sage/rings/integer.pyx", line 6235, in sage.rings.integer.Integer.__array_interface__
Warning: Variable 'numpy' referenced here was set only in doctest marked '# needs numpy'
numpy.array(2**400).dtype
**********************************************************************
File "src/sage/rings/integer.pyx", line 6237, in sage.rings.integer.Integer.__array_interface__
Warning: Variable 'numpy' referenced here was set only in doctest marked '# needs numpy'
numpy.array([1,2,3,0.1]).dtype
[1186 tests, 34.60 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/padics/local_generic.py
**********************************************************************
File "src/sage/rings/padics/local_generic.py", line 333, in sage.rings.padics.local_generic.LocalGeneric.change
Warning: Variable 'K' referenced here was set only in doctest marked '# needs sage.libs.flint sage.rings.padics'
K.change(names='b')
**********************************************************************
File "src/sage/rings/padics/local_generic.py", line 338, in sage.rings.padics.local_generic.LocalGeneric.change
Warning: Variable 'K' referenced here was set only in doctest marked '# needs sage.libs.flint sage.rings.padics'
Kup = K.change(prec=8); Kup
**********************************************************************
File "src/sage/rings/padics/local_generic.py", line 347, in sage.rings.padics.local_generic.LocalGeneric.change
Warning: Variable 'K' referenced here was set only in doctest marked '# needs sage.libs.flint sage.rings.padics'
Kdown = K.change(prec=2); Kdown
[240 tests, 0.50 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/padics/padic_capped_absolute_element.pyx
**********************************************************************
File "src/sage/rings/padics/padic_capped_absolute_element.pyx", line 481, in sage.rings.padics.padic_capped_absolute_element.pAdicCappedAbsoluteElemen
t._exp_newton
Warning: Variable 'w' referenced here was set only in doctest marked '# needs sage.libs.ntl'
x = R(7*w)
**********************************************************************
File "src/sage/rings/padics/padic_capped_absolute_element.pyx", line 481, in sage.rings.padics.padic_capped_absolute_element.pAdicCappedAbsoluteElemen
t._exp_newton
Warning: Variable 'R' referenced here was set only in doctest marked '# needs sage.libs.ntl'
x = R(7*w)
[61 tests, 0.07 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/padics/padic_capped_relative_element.pyx
**********************************************************************
File "src/sage/rings/padics/padic_capped_relative_element.pyx", line 539, in sage.rings.padics.padic_capped_relative_element.pAdicCappedRelativeElemen
t._exp_newton
Warning: Variable 'w' referenced here was set only in doctest marked '# needs sage.libs.ntl'
x = R(7*w)
**********************************************************************
File "src/sage/rings/padics/padic_capped_relative_element.pyx", line 539, in sage.rings.padics.padic_capped_relative_element.pAdicCappedRelativeElemen
t._exp_newton
Warning: Variable 'R' referenced here was set only in doctest marked '# needs sage.libs.ntl'
x = R(7*w)
[83 tests, 0.08 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/padics/padic_fixed_mod_element.pyx
**********************************************************************
File "src/sage/rings/padics/padic_fixed_mod_element.pyx", line 546, in sage.rings.padics.padic_fixed_mod_element.pAdicFixedModElement._exp_newton
Warning: Variable 'w' referenced here was set only in doctest marked '# needs sage.libs.ntl'
x = R(7*w)
**********************************************************************
File "src/sage/rings/padics/padic_fixed_mod_element.pyx", line 546, in sage.rings.padics.padic_fixed_mod_element.pAdicFixedModElement._exp_newton
Warning: Variable 'R' referenced here was set only in doctest marked '# needs sage.libs.ntl'
x = R(7*w)
[66 tests, 0.07 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/padics/padic_floating_point_element.pyx
**********************************************************************
File "src/sage/rings/padics/padic_floating_point_element.pyx", line 423, in sage.rings.padics.padic_floating_point_element.pAdicFloatingPointElement._
exp_newton
Warning: Variable 'w' referenced here was set only in doctest marked '# needs sage.libs.ntl'
x = R(7*w)
**********************************************************************
File "src/sage/rings/padics/padic_floating_point_element.pyx", line 423, in sage.rings.padics.padic_floating_point_element.pAdicFloatingPointElement._
exp_newton
Warning: Variable 'R' referenced here was set only in doctest marked '# needs sage.libs.ntl'
x = R(7*w)
[62 tests, 0.07 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/padics/padic_extension_leaves.py
**********************************************************************
File "src/sage/rings/padics/padic_extension_leaves.py", line 306, in sage.rings.padics.padic_extension_leaves.UnramifiedExtensionRingFixedMod
Warning: Variable 'R' referenced here was set only in doctest marked '# needs sage.libs.flint'
TestSuite(R).run(skip='_test_log',max_runs=4) # long time
[73 tests, 1.76 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/padics/tutorial.py
**********************************************************************
File "src/sage/rings/padics/tutorial.py", line 335, in sage.rings.padics.tutorial
Warning: Variable 'w' referenced here was set only in doctest marked '# needs sage.libs.ntl sage.rings.padics'
(1 + w)^7 # needs sage.libs.ntl
[45 tests, 0.12 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/padics/padic_generic_element.pyx
**********************************************************************
File "src/sage/rings/padics/padic_generic_element.pyx", line 2309, in sage.rings.padics.padic_generic_element.pAdicGenericElement._im_gens_
Warning: Variable 'ww' referenced here was set only in doctest marked '# needs sage.libs.ntl sage.symbolic'
beta(ww*zz) == beta(ww)*beta(zz)
[827 tests, 7.58 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/number_field/number_field.py
**********************************************************************
File "src/sage/rings/number_field/number_field.py", line 1337, in sage.rings.number_field.number_field.NumberField_generic
Warning: Variable 'G' referenced here was set only in doctest marked '# needs sage.libs.linbox sage.modular'
for chi in G: # long time
D = ModularSymbols(chi, 2, -1).cuspidal_subspace().new_subspace().decomposition()
for f in D:
elt = f.q_eigenform(10, 'alpha')[3]
assert elt.is_integral()
**********************************************************************
File "src/sage/rings/number_field/number_field.py", line 1730, in sage.rings.number_field.number_field.NumberField_generic._element_constructor_
Warning: Variable 'QQi' referenced here was set only in doctest marked '# needs sage.libs.linbox sage.symbolic'
QQi(("1", "2"))
**********************************************************************
File "src/sage/rings/number_field/number_field.py", line 1732, in sage.rings.number_field.number_field.NumberField_generic._element_constructor_
Warning: Variable 'QQi' referenced here was set only in doctest marked '# needs sage.libs.linbox sage.symbolic'
QQi((RR(1), RR(2)))
**********************************************************************
File "src/sage/rings/number_field/number_field.py", line 1734, in sage.rings.number_field.number_field.NumberField_generic._element_constructor_
Warning: Variable 'QQi' referenced here was set only in doctest marked '# needs sage.libs.linbox sage.symbolic'
QQi(vector((RR(1), RR(2))))
[2444 tests, 24.61 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/polynomial/hilbert.pyx
**********************************************************************
File "src/sage/rings/polynomial/hilbert.pyx", line 460, in sage.rings.polynomial.hilbert.first_hilbert_series
Warning: Variable 'first_hilbert_series' referenced here was set only in doctest marked '# needs sage.libs.singular'
first_hilbert_series(I)
**********************************************************************
File "src/sage/rings/polynomial/hilbert.pyx", line 462, in sage.rings.polynomial.hilbert.first_hilbert_series
Warning: Variable 'first_hilbert_series' referenced here was set only in doctest marked '# needs sage.libs.singular'
first_hilbert_series(singular(I))
**********************************************************************
File "src/sage/rings/polynomial/hilbert.pyx", line 465, in sage.rings.polynomial.hilbert.first_hilbert_series
Warning: Variable 'first_hilbert_series' referenced here was set only in doctest marked '# needs sage.libs.singular'
first_hilbert_series(I)
**********************************************************************
File "src/sage/rings/polynomial/hilbert.pyx", line 467, in sage.rings.polynomial.hilbert.first_hilbert_series
Warning: Variable 'first_hilbert_series' referenced here was set only in doctest marked '# needs sage.libs.singular'
first_hilbert_series(singular(I))
[24 tests, 0.15 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/polynomial/multi_polynomial.pyx
**********************************************************************
File "src/sage/rings/polynomial/multi_polynomial.pyx", line 2732, in sage.rings.polynomial.multi_polynomial.MPolynomial.is_lorentzian
Warning: Variable 'z' referenced here was set only in doctest marked '# needs sage.rings.real_mpfr'
q = z^2 + w^2
**********************************************************************
File "src/sage/rings/polynomial/multi_polynomial.pyx", line 2732, in sage.rings.polynomial.multi_polynomial.MPolynomial.is_lorentzian
Warning: Variable 'w' referenced here was set only in doctest marked '# needs sage.rings.real_mpfr'
q = z^2 + w^2
[589 tests, 1.13 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/polynomial/polynomial_element.pyx
**********************************************************************
File "src/sage/rings/polynomial/polynomial_element.pyx", line 9205, in sage.rings.polynomial.polynomial_element.Polynomial.is_lorentzian
Warning: Variable 'y' referenced here was set only in doctest marked '# needs sage.rings.real_mpfr'
q = y^2
[2688 tests, 7.65 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/valuation/valuation.py
**********************************************************************
File "src/sage/rings/valuation/valuation.py", line 566, in sage.rings.valuation.valuation.DiscreteValuation.mac_lane_approximants
Warning: Variable 'v2' referenced here was set only in doctest marked '# needs sage.geometry.polyhedron'
v1.phi() * v2.phi() - G # needs sage.rings.padics
**********************************************************************
File "src/sage/rings/valuation/valuation.py", line 568, in sage.rings.valuation.valuation.DiscreteValuation.mac_lane_approximants
Warning: Variable 'w1' referenced here was set only in doctest marked '# needs sage.geometry.polyhedron'
w1.phi() * w2.phi() - G # needs sage.rings.padics
**********************************************************************
File "src/sage/rings/valuation/valuation.py", line 568, in sage.rings.valuation.valuation.DiscreteValuation.mac_lane_approximants
Warning: Variable 'w2' referenced here was set only in doctest marked '# needs sage.geometry.polyhedron'
w1.phi() * w2.phi() - G # needs sage.rings.padics
[233 tests, 3.02 s]
sage -t --long --random-seed=339153682694300961491960201161141957323 src/sage/rings/valuation/augmented_valuation.py
**********************************************************************
File "src/sage/rings/valuation/augmented_valuation.py", line 286, in sage.rings.valuation.augmented_valuation.AugmentedValuation_base
Warning: Variable 'w' referenced here was set only in doctest marked '# needs sage.rings.number_field'
TestSuite(w).run() # long time
**********************************************************************
File "src/sage/rings/valuation/augmented_valuation.py", line 287, in sage.rings.valuation.augmented_valuation.AugmentedValuation_base
Warning: Variable 'ww' referenced here was set only in doctest marked '# needs sage.rings.number_field'
TestSuite(ww).run() # long time
[489 tests, 15.51 s]
Thank you! All fixed now, I think. |
remaining doctests warnings
|
There is a failing doctest with
|
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.
some more issues
sage: W.<w> = K.extension(f) | ||
sage: z = 1 - w^2 + O(w^11) | ||
sage: x = 1 - z | ||
sage: z.log().precision_absolute() | ||
-975 | ||
|
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.
I don't understand why I don't see any warning for x
. It is created in a block with # needs...
and used in another block without # needs...
.
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.
x
is already unconditionally defined, from the global environment, so there won't be warnings
I'm removing the blank line.
@@ -917,7 +918,7 @@ cdef class PowComputer_ZZ_pX(PowComputer_ext): | |||
EXAMPLES:: | |||
|
|||
sage: PC = PowComputer_ext_maker(5, 5, 10, 20, False, ntl.ZZ_pX([-5,0,1],5^10), 'FM', 'e',ntl.ZZ_pX([1],5^10)) | |||
sage: PC._restore_context_capdiv_test(8) #indirect doctest | |||
sage: PC._restore_context_capdiv_test(8) #indirect doctest |
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.
space after #
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.
Done throughout sage.rings.padics
in b28f626
…/#indirect doctest ?/# indirect doctest/'; git grep -l '# indirec' src/sage/rings/padics | xargs sed -E -i.bak 's/([^ ]) # indirect doctest ?/\1 # indirect doctest/'
…, doctest cosmetics
I'm unable to build the documentation (also reported by Lint)
|
Documentation preview for this PR (built with commit 5e4ea11; changes) is ready! 🎉 |
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.
Finally, LGTM.
Thanks very much! |
Another update of
# needs
insage.rings
, with a focus onsage.rings.padics
.In #35095, the distributions sagemath-pari, sagemath-ntl, sagemath-flint, and sagemath-linbox now provide p-adic rings. The feature
sage.rings.padics
covers the common rings implemented using PARI and NTL. Additional rings are provided using FLINT.Cherry-picked from #35095.
📝 Checklist
⌛ Dependencies