Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
fix some more doctest failures
Browse files Browse the repository at this point in the history
  • Loading branch information
yyyyx4 committed Nov 30, 2022
1 parent f9c2d64 commit 636af13
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/sage/modular/dirichlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2339,6 +2339,7 @@ class DirichletGroupFactory(UniqueFactory):
sage: parent(val)
Gaussian Integers in Cyclotomic Field of order 4 and degree 2
sage: r4.residue_field(r4.ideal(29).factor()[0][0])(val)
doctest:warning ... DeprecationWarning: ...
17
sage: r4.residue_field(r4.ideal(29).factor()[0][0])(val) * GF(29)(3)
22
Expand Down
3 changes: 1 addition & 2 deletions src/sage/rings/number_field/bdd_height.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,6 @@ def bdd_height(K, height_bound, tolerance=1e-2, precision=53):
if B < 1:
return
embeddings = K.places(prec=precision)
O_K = K.ring_of_integers()
r1, r2 = K.signature()
r = r1 + r2 - 1
RF = RealField(precision)
Expand Down Expand Up @@ -486,7 +485,7 @@ def log_height_for_generators_approx(alpha, beta, Lambda):
Return a lambda approximation h_K(alpha/beta)
"""
delta = Lambda / (r + 2)
norm_log = delta_approximation(RR(O_K.ideal(alpha, beta).norm()).log(), delta)
norm_log = delta_approximation(RR(K.ideal(alpha, beta).norm()).log(), delta)
log_ga = vector_delta_approximation(log_map(alpha), delta)
log_gb = vector_delta_approximation(log_map(beta), delta)
arch_sum = sum([max(log_ga[k], log_gb[k]) for k in range(r + 1)])
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/padics/padic_valuation.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def create_key_and_extra_args_for_number_field_from_ideal(self, R, I, prime):
EXAMPLES::
sage: GaussianIntegers().valuation(GaussianIntegers().ideal(2)) # indirect doctest
sage: GaussianIntegers().valuation(GaussianIntegers().number_field().fractional_ideal(2)) # indirect doctest
2-adic valuation
TESTS:
Expand Down
7 changes: 5 additions & 2 deletions src/sage/rings/polynomial/polynomial_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ from sage.categories.morphism cimport Morphism
from sage.misc.superseded import deprecation_cython as deprecation, deprecated_function_alias
from sage.misc.cachefunc import cached_method

from sage.rings.number_field.order import is_NumberFieldOrder
from sage.rings.number_field.order import is_NumberFieldOrder, Order as NumberFieldOrder
from sage.categories.number_fields import NumberFields


Expand Down Expand Up @@ -5104,8 +5104,11 @@ cdef class Polynomial(CommutativeAlgebraElement):
y = self._parent.quo(self).gen()
from sage.groups.generic import order_from_multiple
return n == order_from_multiple(y, n, n_prime_divs, operation="*")
elif isinstance(R, NumberFieldOrder):
K = R.number_field()
return K.fractional_ideal(self.coefficients()) == K.fractional_ideal(1)
else:
return R.ideal(self.coefficients())==R.ideal(1)
return R.ideal(self.coefficients()) == R.ideal(1)

def is_constant(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sage/schemes/elliptic_curves/heegner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ def ideal(self):
(A,B,C) = f
if A%c == 0:
A, C = C, A
return K.maximal_order().ideal([A, (-B+c*sqrtD)/2])
return K.fractional_ideal([A, (-B+c*sqrtD)/2])

## def __call__(self, z):
## """
Expand Down

0 comments on commit 636af13

Please sign in to comment.