summaryrefslogtreecommitdiff
path: root/numpy/polynomial
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/polynomial')
-rw-r--r--numpy/polynomial/__init__.py14
-rw-r--r--numpy/polynomial/chebyshev.py8
-rw-r--r--numpy/polynomial/hermite.py8
-rw-r--r--numpy/polynomial/hermite_e.py8
-rw-r--r--numpy/polynomial/laguerre.py8
-rw-r--r--numpy/polynomial/legendre.py8
-rw-r--r--numpy/polynomial/polynomial.py6
-rw-r--r--numpy/polynomial/polytemplate.py13
-rw-r--r--numpy/polynomial/polyutils.py2
-rw-r--r--numpy/polynomial/tests/test_chebyshev.py2
-rw-r--r--numpy/polynomial/tests/test_classes.py2
-rw-r--r--numpy/polynomial/tests/test_hermite.py2
-rw-r--r--numpy/polynomial/tests/test_hermite_e.py2
-rw-r--r--numpy/polynomial/tests/test_laguerre.py2
-rw-r--r--numpy/polynomial/tests/test_legendre.py2
-rw-r--r--numpy/polynomial/tests/test_polynomial.py2
-rw-r--r--numpy/polynomial/tests/test_polyutils.py2
-rw-r--r--numpy/polynomial/tests/test_printing.py2
18 files changed, 44 insertions, 49 deletions
diff --git a/numpy/polynomial/__init__.py b/numpy/polynomial/__init__.py
index 684720828..1e9919614 100644
--- a/numpy/polynomial/__init__.py
+++ b/numpy/polynomial/__init__.py
@@ -13,16 +13,16 @@ implemented as operations on the coefficients. Additional (module-specific)
information can be found in the docstring for the module of interest.
"""
-from __future__ import division
+from __future__ import division, absolute_import
import warnings
-from polynomial import Polynomial
-from chebyshev import Chebyshev
-from legendre import Legendre
-from hermite import Hermite
-from hermite_e import HermiteE
-from laguerre import Laguerre
+from .polynomial import Polynomial
+from .chebyshev import Chebyshev
+from .legendre import Legendre
+from .hermite import Hermite
+from .hermite_e import HermiteE
+from .laguerre import Laguerre
from numpy.testing import Tester
test = Tester().test
diff --git a/numpy/polynomial/chebyshev.py b/numpy/polynomial/chebyshev.py
index 9576a4697..dde4966e7 100644
--- a/numpy/polynomial/chebyshev.py
+++ b/numpy/polynomial/chebyshev.py
@@ -85,13 +85,13 @@ References
(preprint: http://www.math.hmc.edu/~benjamin/papers/CombTrig.pdf, pg. 4)
"""
-from __future__ import division
+from __future__ import division, absolute_import
import numpy as np
import numpy.linalg as la
-import polyutils as pu
+from . import polyutils as pu
import warnings
-from polytemplate import polytemplate
+from .polytemplate import polytemplate
__all__ = ['chebzero', 'chebone', 'chebx', 'chebdomain', 'chebline',
'chebadd', 'chebsub', 'chebmulx', 'chebmul', 'chebdiv', 'chebpow',
@@ -416,7 +416,7 @@ def cheb2poly(c) :
array([ -2., -8., 4., 12.])
"""
- from polynomial import polyadd, polysub, polymulx
+ from .polynomial import polyadd, polysub, polymulx
[c] = pu.as_series([c])
n = len(c)
diff --git a/numpy/polynomial/hermite.py b/numpy/polynomial/hermite.py
index b410902ea..51a0f2fe0 100644
--- a/numpy/polynomial/hermite.py
+++ b/numpy/polynomial/hermite.py
@@ -57,13 +57,13 @@ See also
`numpy.polynomial`
"""
-from __future__ import division
+from __future__ import division, absolute_import
import numpy as np
import numpy.linalg as la
-import polyutils as pu
+from . import polyutils as pu
import warnings
-from polytemplate import polytemplate
+from .polytemplate import polytemplate
__all__ = ['hermzero', 'hermone', 'hermx', 'hermdomain', 'hermline',
'hermadd', 'hermsub', 'hermmulx', 'hermmul', 'hermdiv', 'hermpow',
@@ -160,7 +160,7 @@ def herm2poly(c) :
array([ 0., 1., 2., 3.])
"""
- from polynomial import polyadd, polysub, polymulx
+ from .polynomial import polyadd, polysub, polymulx
[c] = pu.as_series([c])
n = len(c)
diff --git a/numpy/polynomial/hermite_e.py b/numpy/polynomial/hermite_e.py
index 4d3bcd338..9ae3c7067 100644
--- a/numpy/polynomial/hermite_e.py
+++ b/numpy/polynomial/hermite_e.py
@@ -57,13 +57,13 @@ See also
`numpy.polynomial`
"""
-from __future__ import division
+from __future__ import division, absolute_import
import numpy as np
import numpy.linalg as la
-import polyutils as pu
+from . import polyutils as pu
import warnings
-from polytemplate import polytemplate
+from .polytemplate import polytemplate
__all__ = ['hermezero', 'hermeone', 'hermex', 'hermedomain', 'hermeline',
'hermeadd', 'hermesub', 'hermemulx', 'hermemul', 'hermediv', 'hermpow',
@@ -160,7 +160,7 @@ def herme2poly(c) :
array([ 0., 1., 2., 3.])
"""
- from polynomial import polyadd, polysub, polymulx
+ from .polynomial import polyadd, polysub, polymulx
[c] = pu.as_series([c])
n = len(c)
diff --git a/numpy/polynomial/laguerre.py b/numpy/polynomial/laguerre.py
index 7b77ea819..874088b2c 100644
--- a/numpy/polynomial/laguerre.py
+++ b/numpy/polynomial/laguerre.py
@@ -57,13 +57,13 @@ See also
`numpy.polynomial`
"""
-from __future__ import division
+from __future__ import division, absolute_import
import numpy as np
import numpy.linalg as la
-import polyutils as pu
+from . import polyutils as pu
import warnings
-from polytemplate import polytemplate
+from .polytemplate import polytemplate
__all__ = ['lagzero', 'lagone', 'lagx', 'lagdomain', 'lagline',
'lagadd', 'lagsub', 'lagmulx', 'lagmul', 'lagdiv', 'lagpow',
@@ -159,7 +159,7 @@ def lag2poly(c) :
array([ 0., 1., 2., 3.])
"""
- from polynomial import polyadd, polysub, polymulx
+ from .polynomial import polyadd, polysub, polymulx
[c] = pu.as_series([c])
n = len(c)
diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py
index 5b88b6287..ba49cbc57 100644
--- a/numpy/polynomial/legendre.py
+++ b/numpy/polynomial/legendre.py
@@ -81,13 +81,13 @@ numpy.polynomial.hermite
numpy.polynomial.hermite_e
"""
-from __future__ import division
+from __future__ import division, absolute_import
import numpy as np
import numpy.linalg as la
-import polyutils as pu
+from . import polyutils as pu
import warnings
-from polytemplate import polytemplate
+from .polytemplate import polytemplate
__all__ = ['legzero', 'legone', 'legx', 'legdomain', 'legline',
'legadd', 'legsub', 'legmulx', 'legmul', 'legdiv', 'legpow', 'legval',
@@ -191,7 +191,7 @@ def leg2poly(c) :
"""
- from polynomial import polyadd, polysub, polymulx
+ from .polynomial import polyadd, polysub, polymulx
[c] = pu.as_series([c])
n = len(c)
diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py
index e174fdd96..b9a14972e 100644
--- a/numpy/polynomial/polynomial.py
+++ b/numpy/polynomial/polynomial.py
@@ -52,7 +52,7 @@ See also
`numpy.polynomial`
"""
-from __future__ import division
+from __future__ import division, absolute_import
__all__ = ['polyzero', 'polyone', 'polyx', 'polydomain', 'polyline',
'polyadd', 'polysub', 'polymulx', 'polymul', 'polydiv', 'polypow',
@@ -62,9 +62,9 @@ __all__ = ['polyzero', 'polyone', 'polyx', 'polydomain', 'polyline',
import numpy as np
import numpy.linalg as la
-import polyutils as pu
+from . import polyutils as pu
import warnings
-from polytemplate import polytemplate
+from .polytemplate import polytemplate
polytrim = pu.trimcoef
diff --git a/numpy/polynomial/polytemplate.py b/numpy/polynomial/polytemplate.py
index 7d67c914c..adf32170f 100644
--- a/numpy/polynomial/polytemplate.py
+++ b/numpy/polynomial/polytemplate.py
@@ -9,21 +9,16 @@ creating additional specific polynomial classes (e.g., Legendre, Jacobi,
etc.) in the future, such that all these classes will have a common API.
"""
-from __future__ import division
+from __future__ import division, absolute_import
import string
import sys
-if sys.version_info[0] >= 3:
- rel_import = "from . import"
-else:
- rel_import = "import"
-
polytemplate = string.Template('''
-from __future__ import division
+from __future__ import division, absolute_import
import numpy as np
import warnings
-REL_IMPORT polyutils as pu
+from . import polyutils as pu
class $name(pu.PolyBase) :
"""A $name series class.
@@ -918,4 +913,4 @@ class $name(pu.PolyBase) :
"""
return series.convert(domain, $name, window)
-'''.replace('REL_IMPORT', rel_import))
+''')
diff --git a/numpy/polynomial/polyutils.py b/numpy/polynomial/polyutils.py
index 8861328c4..0d3343b04 100644
--- a/numpy/polynomial/polyutils.py
+++ b/numpy/polynomial/polyutils.py
@@ -31,7 +31,7 @@ Functions
- `mapparms` -- parameters of the linear map between domains.
"""
-from __future__ import division
+from __future__ import division, absolute_import
__all__ = ['RankWarning', 'PolyError', 'PolyDomainError', 'PolyBase',
'as_series', 'trimseq', 'trimcoef', 'getdomain', 'mapdomain',
diff --git a/numpy/polynomial/tests/test_chebyshev.py b/numpy/polynomial/tests/test_chebyshev.py
index b5f1d5672..2bf73d02b 100644
--- a/numpy/polynomial/tests/test_chebyshev.py
+++ b/numpy/polynomial/tests/test_chebyshev.py
@@ -1,7 +1,7 @@
"""Tests for chebyshev module.
"""
-from __future__ import division
+from __future__ import division, absolute_import
import numpy as np
import numpy.polynomial.chebyshev as cheb
diff --git a/numpy/polynomial/tests/test_classes.py b/numpy/polynomial/tests/test_classes.py
index fb0d359e0..2439fc8ad 100644
--- a/numpy/polynomial/tests/test_classes.py
+++ b/numpy/polynomial/tests/test_classes.py
@@ -3,7 +3,7 @@
This tests the convert and cast methods of all the polynomial classes.
"""
-from __future__ import division
+from __future__ import division, absolute_import
import numpy as np
from numpy.polynomial import (
diff --git a/numpy/polynomial/tests/test_hermite.py b/numpy/polynomial/tests/test_hermite.py
index 36fa6f0e4..f9b936bbf 100644
--- a/numpy/polynomial/tests/test_hermite.py
+++ b/numpy/polynomial/tests/test_hermite.py
@@ -1,7 +1,7 @@
"""Tests for hermite module.
"""
-from __future__ import division
+from __future__ import division, absolute_import
import numpy as np
import numpy.polynomial.hermite as herm
diff --git a/numpy/polynomial/tests/test_hermite_e.py b/numpy/polynomial/tests/test_hermite_e.py
index 2fcef55da..f7871fe99 100644
--- a/numpy/polynomial/tests/test_hermite_e.py
+++ b/numpy/polynomial/tests/test_hermite_e.py
@@ -1,7 +1,7 @@
"""Tests for hermite_e module.
"""
-from __future__ import division
+from __future__ import division, absolute_import
import numpy as np
import numpy.polynomial.hermite_e as herme
diff --git a/numpy/polynomial/tests/test_laguerre.py b/numpy/polynomial/tests/test_laguerre.py
index 915234b93..2aabda114 100644
--- a/numpy/polynomial/tests/test_laguerre.py
+++ b/numpy/polynomial/tests/test_laguerre.py
@@ -1,7 +1,7 @@
"""Tests for laguerre module.
"""
-from __future__ import division
+from __future__ import division, absolute_import
import numpy as np
import numpy.polynomial.laguerre as lag
diff --git a/numpy/polynomial/tests/test_legendre.py b/numpy/polynomial/tests/test_legendre.py
index 500269484..cd3db4e35 100644
--- a/numpy/polynomial/tests/test_legendre.py
+++ b/numpy/polynomial/tests/test_legendre.py
@@ -1,7 +1,7 @@
"""Tests for legendre module.
"""
-from __future__ import division
+from __future__ import division, absolute_import
import numpy as np
import numpy.polynomial.legendre as leg
diff --git a/numpy/polynomial/tests/test_polynomial.py b/numpy/polynomial/tests/test_polynomial.py
index e8268d25f..c93421c7d 100644
--- a/numpy/polynomial/tests/test_polynomial.py
+++ b/numpy/polynomial/tests/test_polynomial.py
@@ -1,7 +1,7 @@
"""Tests for polynomial module.
"""
-from __future__ import division
+from __future__ import division, absolute_import
import numpy as np
import numpy.polynomial.polynomial as poly
diff --git a/numpy/polynomial/tests/test_polyutils.py b/numpy/polynomial/tests/test_polyutils.py
index 14bf8bb78..95a8f39bb 100644
--- a/numpy/polynomial/tests/test_polyutils.py
+++ b/numpy/polynomial/tests/test_polyutils.py
@@ -1,7 +1,7 @@
"""Tests for polyutils module.
"""
-from __future__ import division
+from __future__ import division, absolute_import
import numpy as np
import numpy.polynomial.polyutils as pu
diff --git a/numpy/polynomial/tests/test_printing.py b/numpy/polynomial/tests/test_printing.py
index 889966051..3974620a7 100644
--- a/numpy/polynomial/tests/test_printing.py
+++ b/numpy/polynomial/tests/test_printing.py
@@ -1,4 +1,4 @@
-from __future__ import division
+from __future__ import division, absolute_import
import numpy.polynomial as poly
from numpy.testing import TestCase, run_module_suite, assert_