Skip to content

Commit 70e5c66

Browse files
author
Matthias Koeppe
committed
sage.{functions,interfaces,symbolic}: Consolidate imports from the same module
1 parent 2870ffb commit 70e5c66

File tree

3 files changed

+22
-31
lines changed

3 files changed

+22
-31
lines changed

src/sage/functions/hypergeometric.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -162,29 +162,28 @@
162162
# https://www.gnu.org/licenses/
163163
# ****************************************************************************
164164

165+
from functools import reduce
166+
167+
from sage.arith.misc import binomial, factorial, rising_factorial
168+
from sage.calculus.functional import derivative
169+
from sage.libs.mpmath import utils as mpmath_utils
170+
from sage.misc.latex import latex
171+
from sage.misc.misc_c import prod
172+
from sage.rings.infinity import Infinity
165173
from sage.rings.integer import Integer
166174
from sage.rings.integer_ring import ZZ
167175
from sage.rings.rational_field import QQ
168-
from sage.rings.infinity import Infinity
169-
from sage.arith.misc import binomial
170-
from sage.arith.misc import rising_factorial
171-
from sage.arith.misc import factorial
176+
from sage.structure.element import get_coercion_model
172177
from sage.symbolic.constants import pi
178+
from sage.symbolic.expression import Expression
173179
from sage.symbolic.function import BuiltinFunction
174180
from sage.symbolic.ring import SR
175-
from sage.structure.element import get_coercion_model
176-
from sage.misc.latex import latex
177-
from sage.misc.misc_c import prod
178-
from sage.libs.mpmath import utils as mpmath_utils
179-
from sage.symbolic.expression import Expression
180-
from sage.calculus.functional import derivative
181-
from functools import reduce
182181

182+
from .error import erf
183183
from .gamma import gamma
184-
from .other import sqrt, real_part
185-
from .log import exp, log
186184
from .hyperbolic import cosh, sinh
187-
from .error import erf
185+
from .log import exp, log
186+
from .other import sqrt, real_part
188187

189188

190189
def rational_param_as_tuple(x):

src/sage/functions/piecewise.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,9 +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.symbolic.assumptions import assume
1092+
from sage.symbolic.assumptions import assume, forget
10931093
from sage.functions.log import exp
1094-
from sage.symbolic.assumptions import forget
1094+
10951095
x = SR.var(x)
10961096
s = SR.var(s)
10971097
assume(s>0)
@@ -1363,9 +1363,9 @@ def fourier_series_partial_sum(self, parameters, variable, N,
13631363
13641364
"""
13651365
from sage.symbolic.constants import pi
1366-
from sage.functions.trig import sin
1367-
from sage.functions.trig import cos
1366+
from sage.functions.trig import cos, sin
13681367
from sage.arith.srange import srange
1368+
13691369
if not L:
13701370
L = (self.domain().sup() - self.domain().inf()) / 2
13711371
x = self.default_variable()

src/sage/symbolic/pynac_impl.pxi

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,26 @@ Pynac interface
3535
from cpython cimport *
3636
from libc cimport math
3737

38+
from sage.arith.misc import bernoulli, factorial, GCD as gcd, is_prime
39+
from sage.arith.functions import lcm
40+
from sage.cpython.string cimport str_to_bytes, char_to_str
3841
from sage.ext.stdsage cimport PY_NEW
3942
from sage.libs.gmp.all cimport *
4043
from sage.libs.gsl.types cimport *
4144
from sage.libs.gsl.complex cimport *
4245
from sage.libs.gsl.gamma cimport gsl_sf_lngamma_complex_e
4346
from sage.libs.mpmath import utils as mpmath_utils
4447
from sage.libs.pari.all import pari
45-
46-
from sage.cpython.string cimport str_to_bytes, char_to_str
47-
48-
from sage.arith.misc import GCD as gcd
49-
from sage.arith.functions import lcm
50-
from sage.arith.misc import is_prime
51-
from sage.arith.misc import factorial
52-
from sage.arith.misc import bernoulli
53-
54-
from sage.structure.coerce cimport coercion_model
55-
from sage.structure.element cimport Element, parent
5648
from sage.misc.persist import loads, dumps
57-
5849
from sage.rings.integer_ring import ZZ
5950
from sage.rings.integer cimport Integer, smallInteger
6051
from sage.rings.rational cimport Rational
6152
from sage.rings.real_mpfr import RR, RealField
6253
from sage.rings.rational cimport rational_power_parts
6354
from sage.rings.real_double cimport RealDoubleElement
6455
from sage.rings.cc import CC
65-
56+
from sage.structure.coerce cimport coercion_model
57+
from sage.structure.element cimport Element, parent
6658
from sage.symbolic.function cimport Function
6759

6860

0 commit comments

Comments
 (0)