Skip to content

Commit 21148e5

Browse files
alexchandler100Matthias Koeppe
authored andcommitted
sage -fiximports src/sage/{functions,interfaces,symbolic}
1 parent 047281e commit 21148e5

File tree

12 files changed

+49
-26
lines changed

12 files changed

+49
-26
lines changed

src/sage/functions/hypergeometric.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@
166166
from sage.rings.integer_ring import ZZ
167167
from sage.rings.rational_field import QQ
168168
from sage.rings.infinity import Infinity
169-
from sage.arith.all import binomial, rising_factorial, factorial
169+
from sage.arith.misc import binomial
170+
from sage.arith.misc import rising_factorial
171+
from sage.arith.misc import factorial
170172
from sage.symbolic.constants import pi
171173
from sage.symbolic.function import BuiltinFunction
172174
from sage.symbolic.ring import SR

src/sage/functions/piecewise.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,9 @@ def laplace(self, parameters, variable, x='x', s='t'):
10891089
sage: f.laplace(t,s)
10901090
(s + 1)*e^(-s)/s^2 + 2*e^(-s)/s - 1/s^2
10911091
"""
1092-
from sage.all import assume, exp, forget
1092+
from sage.symbolic.assumptions import assume
1093+
from sage.functions.log import exp
1094+
from sage.symbolic.assumptions import forget
10931095
x = SR.var(x)
10941096
s = SR.var(s)
10951097
assume(s>0)
@@ -1180,7 +1182,8 @@ def fourier_series_cosine_coefficient(self, parameters,
11801182
-3/5/pi
11811183
11821184
"""
1183-
from sage.all import cos, pi
1185+
from sage.functions.trig import cos
1186+
from sage.symbolic.constants import pi
11841187
L0 = (self.domain().sup() - self.domain().inf()) / 2
11851188
if not L:
11861189
L = L0
@@ -1270,7 +1273,8 @@ def fourier_series_sine_coefficient(self, parameters, variable,
12701273
4/3/pi
12711274
12721275
"""
1273-
from sage.all import sin, pi
1276+
from sage.functions.trig import sin
1277+
from sage.symbolic.constants import pi
12741278
L0 = (self.domain().sup() - self.domain().inf()) / 2
12751279
if not L:
12761280
L = L0
@@ -1358,7 +1362,10 @@ def fourier_series_partial_sum(self, parameters, variable, N,
13581362
- 4/9*sin(3*pi*x)/pi^2 + 4*sin(pi*x)/pi^2 + 1/4
13591363
13601364
"""
1361-
from sage.all import pi, sin, cos, srange
1365+
from sage.symbolic.constants import pi
1366+
from sage.functions.trig import sin
1367+
from sage.functions.trig import cos
1368+
from sage.arith.srange import srange
13621369
if not L:
13631370
L = (self.domain().sup() - self.domain().inf()) / 2
13641371
x = self.default_variable()

src/sage/interfaces/axiom.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,8 @@ def _sage_(self):
836836
return self._sage_domain()
837837

838838
if type == "Float":
839-
from sage.rings.all import RealField, ZZ
839+
from sage.rings.real_mpfr import RealField
840+
from sage.rings.integer_ring import Z as ZZ
840841
prec = max(self.mantissa().length()._sage_(), 53)
841842
R = RealField(prec)
842843
x,e,b = self.unparsed_input_form().lstrip('float(').rstrip(')').split(',')

src/sage/interfaces/fricas.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,9 @@ def _get_sage_type(self, domain):
12171217
sage: fricas(0)._get_sage_type(m) # optional - fricas
12181218
Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Algebraic Field
12191219
"""
1220-
from sage.rings.all import QQbar, RDF, PolynomialRing
1220+
from sage.rings.qqbar import QQbar
1221+
from sage.rings.real_double import RDF
1222+
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
12211223
from sage.rings.fraction_field import FractionField
12221224
from sage.rings.finite_rings.integer_mod_ring import Integers
12231225
from sage.rings.finite_rings.finite_field_constructor import FiniteField
@@ -1730,7 +1732,8 @@ def convert_rootOf(x, y):
17301732

17311733
ex, _ = FriCASElement._parse_and_eval(fricas_InputForm)
17321734
# postprocessing of rootOf
1733-
from sage.rings.all import QQbar, PolynomialRing
1735+
from sage.rings.qqbar import QQbar
1736+
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
17341737
while rootOf:
17351738
for var, poly in rootOf.items():
17361739
pvars = poly.variables()

src/sage/interfaces/genus2reduction.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
# ****************************************************************************
3535

3636
from sage.structure.sage_object import SageObject
37-
from sage.rings.all import ZZ, QQ, PolynomialRing
37+
from sage.rings.integer_ring import Z as ZZ
38+
from sage.rings.rational_field import Q as QQ
39+
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
3840
from sage.libs.pari.all import pari
3941

4042
roman_numeral = ["", "I", "II", "III", "IV", "V", "VI", "VII"]

src/sage/interfaces/maxima_abstract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@ def _matrix_(self, R):
18461846
[ 3 3/2 1 3/4]
18471847
[ 4 2 4/3 1]
18481848
"""
1849-
from sage.matrix.all import MatrixSpace
1849+
from sage.matrix.matrix_space import MatrixSpace
18501850
self._check_valid()
18511851
P = self.parent()
18521852
nrows = int(P.eval('length(%s)'%self.name()))

src/sage/interfaces/octave.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ def solve_linear_system(self, A, b):
508508
m = A.nrows()
509509
if m != len(b):
510510
raise ValueError("dimensions of A and b must be compatible")
511-
from sage.matrix.all import MatrixSpace
511+
from sage.matrix.matrix_space import MatrixSpace
512512
from sage.rings.rational_field import QQ
513513
MS = MatrixSpace(QQ,m,1)
514514
b = MS(list(b)) # converted b to a "column vector"
@@ -707,7 +707,7 @@ def _matrix_(self, R=None):
707707
if self.iscomplex():
708708
w = [[to_complex(x,R) for x in row] for row in w]
709709

710-
from sage.matrix.all import MatrixSpace
710+
from sage.matrix.matrix_space import MatrixSpace
711711
return MatrixSpace(R, nrows, ncols)(w)
712712

713713
def _vector_(self, R=None):

src/sage/interfaces/scilab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def _matrix_(self, R):
486486
[1.00000000000000 2.00000000000000]
487487
[3.00000000000000 4.50000000000000]
488488
"""
489-
from sage.matrix.all import MatrixSpace
489+
from sage.matrix.matrix_space import MatrixSpace
490490
s = str(self).strip()
491491
v = s.split('\n ')
492492
nrows = len(v)

src/sage/interfaces/singular.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,15 +1656,19 @@ def sage_global_ring(self):
16561656
br = ZZ
16571657
is_extension = False
16581658
elif charstr[0] in ['0', 'QQ']:
1659-
from sage.all import QQ
1659+
from sage.rings.rational_field import Q as QQ
16601660
br = QQ
16611661
elif charstr[0].startswith('Float'):
1662-
from sage.all import RealField, ceil, log
1662+
from sage.rings.real_mpfr import RealField
1663+
from sage.functions.other import ceil
1664+
from sage.misc.functional import log
16631665
prec = singular.eval('ringlist(basering)[1][2][1]')
16641666
br = RealField(ceil((ZZ(prec)+1)/log(2,10)))
16651667
is_extension = False
16661668
elif charstr[0]=='complex':
1667-
from sage.all import ComplexField, ceil, log
1669+
from sage.rings.complex_mpfr import ComplexField
1670+
from sage.functions.other import ceil
1671+
from sage.misc.functional import log
16681672
prec = singular.eval('ringlist(basering)[1][2][1]')
16691673
br = ComplexField(ceil((ZZ(prec)+1)/log(2,10)))
16701674
is_extension = False
@@ -1684,7 +1688,7 @@ def sage_global_ring(self):
16841688
if is_extension:
16851689
minpoly = singular.eval('minpoly')
16861690
if minpoly == '0':
1687-
from sage.all import Frac
1691+
from sage.rings.fraction_field import FractionField as Frac
16881692
BR = Frac(br[charstr[1]])
16891693
else:
16901694
is_short = singular.eval('short')
@@ -1701,7 +1705,7 @@ def sage_global_ring(self):
17011705
# Now, we form the polynomial ring over BR with the given variables,
17021706
# using Singular's term order
17031707
from sage.rings.polynomial.term_order import termorder_from_singular
1704-
from sage.all import PolynomialRing
1708+
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
17051709
# Meanwhile Singulars quotient rings are also of 'ring' type, not 'qring' as it was in the past.
17061710
# To find out if a singular ring is a quotient ring or not checking for ring type does not help
17071711
# and instead of that we check if the quotient ring is zero or not:

src/sage/interfaces/sympy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def _sympysage_rf(self):
453453
sage: assert rising_factorial(x,y)._sympy_() == rfxy.rewrite('gamma', piecewise=False)
454454
sage: assert rising_factorial(x,y) == rfxy._sage_()
455455
"""
456-
from sage.arith.all import rising_factorial
456+
from sage.arith.misc import rising_factorial
457457
return rising_factorial(self.args[0]._sage_(), self.args[1]._sage_())
458458

459459
def _sympysage_ff(self):
@@ -466,7 +466,7 @@ def _sympysage_ff(self):
466466
sage: assert falling_factorial(x,y)._sympy_() == ffxy.rewrite('gamma') # known bug
467467
sage: assert falling_factorial(x,y) == ffxy._sage_()
468468
"""
469-
from sage.arith.all import falling_factorial
469+
from sage.arith.misc import falling_factorial
470470
return falling_factorial(self.args[0]._sage_(), self.args[1]._sage_())
471471

472472
def _sympysage_lgamma(self):

0 commit comments

Comments
 (0)