Skip to content

Commit f2f448f

Browse files
authored
Merge pull request #435 from grlee77/cython_language_level
BLD: set language_level=3 for Cython
2 parents f0f4ee0 + cf492ae commit f2f448f

8 files changed

Lines changed: 19 additions & 18 deletions

File tree

pywt/_extensions/_cwt.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#cython: boundscheck=False, wraparound=False
2-
cimport common, c_wt
3-
from common cimport pywt_index_t, MODE
2+
from . cimport common
3+
from . cimport c_wt
4+
from .common cimport pywt_index_t, MODE
45
from ._pywt cimport _check_dtype
56

67
cimport numpy as np

pywt/_extensions/_dwt.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#cython: boundscheck=False, wraparound=False
2-
cimport common, c_wt
3-
from common cimport pywt_index_t, MODE
2+
from . cimport common
3+
from . cimport c_wt
4+
from .common cimport pywt_index_t, MODE
45
from ._pywt cimport _check_dtype
56

67
cimport numpy as np

pywt/_extensions/_pywt.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cimport wavelet
1+
from . cimport wavelet
22
cimport numpy as np
33
include "config.pxi"
44

pywt/_extensions/_pywt.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2006-2012 Filip Wasilewski <http://en.ig.ma/>
2-
# Copyright (c) 2012-2016 The PyWavelets Developers
2+
# Copyright (c) 2012-2018 The PyWavelets Developers
33
# <https://github.com/PyWavelets/pywt>
44
# See COPYING for license details.
55

@@ -11,8 +11,8 @@ __all__ = ['MODES', 'Modes', 'DiscreteContinuousWavelet', 'Wavelet',
1111
import warnings
1212
import re
1313

14-
cimport c_wt
15-
cimport common
14+
from . cimport c_wt
15+
from . cimport common
1616
from ._dwt cimport upcoef
1717
from ._cwt cimport cwt_psi_single
1818

@@ -1044,7 +1044,7 @@ cpdef np.dtype _check_dtype(data):
10441044
def keep(arr, keep_length):
10451045
length = len(arr)
10461046
if keep_length < length:
1047-
left_bound = (length - keep_length) / 2
1047+
left_bound = (length - keep_length) // 2
10481048
return arr[left_bound:left_bound + keep_length]
10491049
return arr
10501050

pywt/_extensions/_swt.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#cython: boundscheck=False, wraparound=False
2-
cimport common
3-
cimport c_wt
2+
from . cimport common
3+
from . cimport c_wt
44

55
import warnings
66
import numpy as np
77
cimport numpy as np
88

9-
from common cimport pywt_index_t
9+
from .common cimport pywt_index_t
1010
from ._pywt cimport c_wavelet_from_object, cdata_t, Wavelet, _check_dtype
1111

1212
include "config.pxi"

pywt/_extensions/c_wt.pxd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# <https://github.com/PyWavelets/pywt>
44
# See COPYING for license details.
55

6-
from common cimport (MODE, pywt_index_t, ArrayInfo, Coefficient,
7-
DiscreteTransformType)
8-
from wavelet cimport DiscreteWavelet, ContinuousWavelet
6+
from .common cimport (MODE, pywt_index_t, ArrayInfo, Coefficient,
7+
DiscreteTransformType)
8+
from .wavelet cimport DiscreteWavelet, ContinuousWavelet
99

1010
include "config.pxi"
1111

pywt/_extensions/wavelet.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from common cimport pywt_index_t
1+
from .common cimport pywt_index_t
22

33
cdef extern from "c/wavelets.h":
44
ctypedef enum SYMMETRY:

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ def get_cython_sources(use_cython):
162162
for k, v in py_defines.items():
163163
fd.write('%s = %d\n' % (k, int(v)))
164164

165-
166-
cythonize_opts = {}
165+
cythonize_opts = {'language_level': '3'}
167166
if os.environ.get("CYTHON_TRACE"):
168167
cythonize_opts['linetrace'] = True
169168
cython_macros.append(("CYTHON_TRACE_NOGIL", 1))

0 commit comments

Comments
 (0)