Skip to content

Commit

Permalink
Remove remaining imports from sage.misc.all
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Dec 7, 2021
1 parent d114096 commit 1ab9441
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/sage/databases/cremona.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import sage.schemes.elliptic_curves.constructor as elliptic
from .sql_db import SQLDatabase, verify_column
from sage.features.databases import DatabaseCremona
from sage.misc.all import walltime
from sage.misc.misc import walltime

import re
import string
Expand Down
2 changes: 1 addition & 1 deletion src/sage/interfaces/gnuplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def plot3d_parametric(self, f='cos(u)*(3 + v*cos(u/2)), sin(u)*(3 + v*cos(u/2)),
self(cmd)

def interact(self, cmd):
from sage.misc.all import SAGE_TMP
from sage.misc.misc import SAGE_TMP
file = os.path.join(SAGE_TMP, 'gnuplot')
with open(file, 'w') as f:
f.write(cmd + '\n pause -1 "Press return to continue (no further rotation possible)"')
Expand Down
2 changes: 1 addition & 1 deletion src/sage/lfunctions/lcalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import os

from sage.structure.sage_object import SageObject
from sage.misc.all import pager
from sage.misc.pager import pager
import sage.rings.all
import sage.schemes.elliptic_curves.ell_generic

Expand Down
2 changes: 1 addition & 1 deletion src/sage/lfunctions/sympow.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import os

from sage.structure.sage_object import SageObject
from sage.misc.all import pager
from sage.misc.pager import pager
from sage.misc.verbose import verbose
import sage.rings.all

Expand Down
2 changes: 1 addition & 1 deletion src/sage/modular/modform/half_integral.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def half_integral_weight_modform_basis(chi, k, prec):
B = C.basis()

# This computation of S below -- of course --dominates the whole function.
#from sage.misc.all import cputime
#from sage.misc.misc import cputime
#tm = cputime()
#print "Computing basis..."
S = [f.q_expansion(prec) for f in B]
Expand Down
2 changes: 1 addition & 1 deletion src/sage/numerical/backends/glpk_backend.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2497,7 +2497,7 @@ cdef class GLPKBackend(GenericBackend):
End of report
"""

from sage.misc.all import SAGE_TMP
from sage.misc.misc import SAGE_TMP

if filename is None:
fname = SAGE_TMP + "/ranges.tmp"
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/padics/relaxed_template.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -2001,7 +2001,7 @@ cdef class RelaxedElement(pAdicGenericElement):
:func:`dumps`, :func:`loads`
"""
tester = self._tester(**options)
from sage.misc.all import loads, dumps
from sage.misc.persist import loads, dumps
if self._precbound >= maxordp:
tester.assertEqual(loads(dumps(self)), self.at_precision_relative())
else:
Expand Down
13 changes: 10 additions & 3 deletions src/sage/sandpiles/sandpile.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,19 @@
from sage.topology.simplicial_complex import SimplicialComplex
from sage.interfaces.singular import singular
from sage.matrix.constructor import matrix, identity_matrix
from sage.misc.all import prod, det, tmp_filename, exists, denominator
from sage.misc.functional import det, denominator
from sage.misc.misc import exists
from sage.misc.misc_c import prod
from sage.misc.temporary_file import tmp_filename
from sage.arith.srange import xsrange
from sage.modules.free_module_element import vector
from sage.plot.colors import rainbow
from sage.arith.all import falling_factorial, lcm
from sage.rings.all import Integer, PolynomialRing, QQ, ZZ
from sage.arith.functions import lcm
from sage.arith.misc import falling_factorial
from sage.rings.integer import Integer
from sage.rings.integer_ring import ZZ
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.rational_field import QQ
from sage.symbolic.constants import I, pi
from sage.symbolic.ring import SR
from sage.features.four_ti_2 import FourTi2Executable
Expand Down
2 changes: 1 addition & 1 deletion src/sage/schemes/curves/affine_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@

from sage.arith.misc import binomial
from sage.interfaces.all import singular
from sage.misc.all import add
from builtins import sum as add

from sage.categories.fields import Fields
from sage.categories.finite_fields import FiniteFields
Expand Down
6 changes: 4 additions & 2 deletions src/sage/schemes/curves/projective_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,11 @@

from sage.interfaces.all import singular
from sage.matrix.constructor import matrix
from sage.misc.all import add, sage_eval
from builtins import sum as add
from sage.misc.sage_eval import sage_eval

from sage.rings.all import degree_lowest_rational_function, IntegerRing
from sage.rings.all import degree_lowest_rational_function
from sage.rings.integer_ring import IntegerRing
from sage.rings.number_field.number_field import NumberField
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.qqbar import (number_field_elements_from_algebraics,
Expand Down
2 changes: 1 addition & 1 deletion src/sage/schemes/elliptic_curves/ell_curve_isogeny.py
Original file line number Diff line number Diff line change
Expand Up @@ -1860,7 +1860,7 @@ def __init_from_kernel_list(self, kernel_gens):
# but it won't speed things up too much.

kernel_set = Set([self.__E1(0)])
from sage.misc.all import flatten
from sage.misc.flatten import flatten

def all_multiples(itr, terminal):
mult_list = [terminal]
Expand Down
2 changes: 1 addition & 1 deletion src/sage/schemes/elliptic_curves/ell_egros.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.misc.all import xmrange
from sage.misc.mrange import xmrange
from sage.rings.rational_field import QQ
from .constructor import EllipticCurve, EllipticCurve_from_j

Expand Down
3 changes: 2 additions & 1 deletion src/sage/schemes/elliptic_curves/isogeny_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
import sage.databases.cremona
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.misc.all import flatten, cached_method
from sage.misc.flatten import flatten
from sage.misc.cachefunc import cached_method
from sage.schemes.elliptic_curves.ell_field import EllipticCurve_field
from sage.schemes.elliptic_curves.ell_number_field import EllipticCurve_number_field

Expand Down
9 changes: 4 additions & 5 deletions src/sage/schemes/elliptic_curves/padic_lseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,13 @@
from sage.rings.all import LaurentSeriesRing, PowerSeriesRing, PolynomialRing, Integers

from sage.rings.integer import Integer
from sage.arith.all import valuation, binomial, kronecker_symbol, gcd, prime_divisors
from sage.arith.all import valuation, binomial, kronecker_symbol, gcd, prime_divisors, LCM

from sage.structure.sage_object import SageObject
from sage.structure.richcmp import richcmp_method, richcmp

from sage.misc.all import denominator
from sage.misc.functional import denominator
from sage.misc.verbose import verbose, get_verbose
import sage.arith.all as arith

from sage.modules.free_module_element import vector
import sage.matrix.all as matrix
Expand Down Expand Up @@ -1671,8 +1670,8 @@ def Dp_valued_height(self,prec=20):
elog = Ehat.log(prec + Integer(3))

# we will have to do it properly with David Harvey's _multiply_point()
n = arith.LCM(E.tamagawa_numbers())
n = arith.LCM(n, E.Np(p)) # allowed here because E has good reduction at p
n = LCM(E.tamagawa_numbers())
n = LCM(n, E.Np(p)) # allowed here because E has good reduction at p

def height(P,check=True):
if P.is_finite_order():
Expand Down
6 changes: 4 additions & 2 deletions src/sage/schemes/toric/chow_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,16 @@
# ****************************************************************************
from __future__ import annotations

from sage.misc.all import flatten
from sage.misc.flatten import flatten
from sage.misc.fast_methods import WithEqualityById
from sage.modules.fg_pid.fgp_module import FGP_Module_class
from sage.modules.fg_pid.fgp_element import FGP_Element
from sage.modules.free_module import FreeModule
from sage.structure.sage_object import SageObject
from sage.structure.factory import UniqueFactory
from sage.rings.all import ZZ, QQ, Infinity
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.rings.infinity import Infinity

import sage.geometry.abc
from sage.schemes.toric.variety import is_ToricVariety
Expand Down
2 changes: 1 addition & 1 deletion src/sage/symbolic/expression.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,7 @@ cdef class Expression(Expression_abc):
MATHML version of the string pi + 2
"""
from sage.misc.all import mathml
from sage.misc.mathml import mathml
try:
obj = self.pyobject()
except TypeError:
Expand Down

0 comments on commit 1ab9441

Please sign in to comment.