[python-dtcwt] 341/497: rename dtcwt backend modules

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Jul 21 18:06:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/sid
in repository python-dtcwt.

commit 7a3555358d4f959db493953545ee4e7193fe0b81
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date:   Thu Feb 6 23:26:24 2014 +0000

    rename dtcwt backend modules
    
    A bit rename patch mapping ``dtcwt.backend.backend_numpy`` and
    ``dtcwt.backend.backend_opencl`` to ``dtcwt.numpy`` and
    ``dtcwt.opencl``.
---
 docs/2dtransform.rst                               |  2 +-
 docs/backends.rst                                  | 14 ++--
 docs/reference.rst                                 | 16 +---
 docs/registration.rst                              |  2 +-
 docs/variant.rst                                   |  6 +-
 dtcwt/__init__.py                                  |  6 ++
 dtcwt/backend/__init__.py                          |  0
 dtcwt/backend/base.py                              | 96 ----------------------
 dtcwt/lowlevel.py                                  |  2 +-
 dtcwt/{backend/backend_numpy => numpy}/__init__.py |  2 +-
 dtcwt/{backend/backend_numpy => numpy}/lowlevel.py |  0
 .../backend_numpy => numpy}/transform2d.py         | 48 ++++++++++-
 .../{backend/backend_opencl => opencl}/__init__.py |  0
 .../{backend/backend_opencl => opencl}/lowlevel.py |  0
 .../backend_opencl => opencl}/transform2d.py       | 10 +--
 dtcwt/plotting.py                                  |  2 +-
 dtcwt/registration/numpybackend.py                 | 10 +--
 dtcwt/transform2d.py                               |  3 +-
 examples/image-registration.py                     |  2 +-
 examples/register_images.py                        |  4 +-
 examples/register_video.py                         |  2 +-
 scripts/benchmark_opencl.py                        | 12 +--
 tests/testopenclcoldfilt.py                        |  2 +-
 tests/testopenclcolfilter.py                       |  2 +-
 tests/testopenclcolifilt.py                        |  2 +-
 tests/testopenclxfm2.py                            |  2 +-
 tests/testregistration.py                          |  2 +-
 tests/util.py                                      |  2 +-
 28 files changed, 95 insertions(+), 156 deletions(-)

diff --git a/docs/2dtransform.rst b/docs/2dtransform.rst
index f297dd2..528805c 100644
--- a/docs/2dtransform.rst
+++ b/docs/2dtransform.rst
@@ -15,7 +15,7 @@ wavelet coefficients:
     figure(1)
     imshow(lena, cmap=cm.gray, clim=(0,1))
 
-    import dtcwt.backend.backend_numpy as backend
+    import dtcwt.numpy as backend
     transform = backend.Transform2d()
 
     # Compute two levels of dtcwt with the defaul wavelet family
diff --git a/docs/backends.rst b/docs/backends.rst
index 837156d..df4efa9 100644
--- a/docs/backends.rst
+++ b/docs/backends.rst
@@ -45,22 +45,22 @@ transform sees around a times 10 speed improvement.
 Using a backend
 '''''''''''''''
 
-The NumPy and OpenCL backends live in the :py:mod:`dtcwt.backend.backend_numpy`
-and :py:mod:`dtcwt.backend.backend_opencl` modules respectively. Both provide
-the same base API as defined in :py:mod:`dtcwt.backend.base`.
+The NumPy and OpenCL backends live in the :py:mod:`dtcwt.numpy`
+and :py:mod:`dtcwt.opencl` modules respectively. Both provide
+implementations of some subset of the DTCWT library functionality.
 
-Access to the 2D transform is via a :py:class:`Transform2d` instance. For
+Access to the 2D transform is via a :py:class:`dtcwt.Transform2d` instance. For
 example, to compute the 2D DT-CWT of the 2D real array in *X*::
 
-    >>> from dtcwt.backend.backend_numpy import Transform2d
+    >>> from dtcwt.numpy import Transform2d
     >>> trans = Transform2d()           # You may optionally specify which wavelets to use here
     >>> Y = trans.forward(X, nlevels=4) # Perform a 4-level transform of X
     >>> imshow(Y.lowpass)               # Show coarsest scale low-pass image
     >>> imshow(Y.subbands[-1][:,:,0])   # Show first coarsest scale subband
 
 In this case *Y* is an instance of a class which behaves like
-:py:class:`dtcwt.backend.base.TransformDomainSignal`. Backends are free to
+:py:class:`dtcwt.TransformDomainSignal`. Backends are free to
 return whatever result they like as long as the result can be used like this
 base class. (For example, the OpenCL backend returns a
-:py:class:`dtcwt.backend.backend_opencl.TransformDomainSignal` instance which
+:py:class:`dtcwt.opencl.TransformDomainSignal` instance which
 keeps the device-side results available.)
diff --git a/docs/reference.rst b/docs/reference.rst
index 8ac3b73..9dc898d 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -16,29 +16,17 @@ These functions provide API-level compatibility with MATLAB.
 .. automodule:: dtcwt
     :members:
 
-Backends
-````````
-
-.. automodule:: dtcwt.backend
-    :members:
-
-Base classes
-''''''''''''
-
-.. automodule:: dtcwt.backend.base
-    :members:
-
 NumPy
 '''''
 
-.. automodule:: dtcwt.backend.backend_numpy
+.. automodule:: dtcwt.numpy
     :members:
     :inherited-members:
 
 OpenCL
 ''''''
 
-.. automodule:: dtcwt.backend.backend_opencl
+.. automodule:: dtcwt.opencl
     :inherited-members:
 
 Keypoint analysis
diff --git a/docs/registration.rst b/docs/registration.rst
index fd4507b..05adb57 100644
--- a/docs/registration.rst
+++ b/docs/registration.rst
@@ -288,7 +288,7 @@ To register the images we first take the DTCWT:
 .. ipython::
     :doctest:
 
-    In [5]: import dtcwt.backend.backend_numpy as backend
+    In [5]: import dtcwt.numpy as backend
 
     In [6]: transform = backend.Transform2d()
 
diff --git a/docs/variant.rst b/docs/variant.rst
index cc86230..ee90436 100644
--- a/docs/variant.rst
+++ b/docs/variant.rst
@@ -29,7 +29,7 @@ Usage is very similar to the standard 2-D transform function, but one uses the
 
 .. code-block::
 
-    import dtcwt.backend.backend_numpy as backend
+    import dtcwt.numpy as backend
     transform = backend.Transform2d(biort='near_sym_bp', qshift='qshift_bp')
 
     # .. load image and select number of levels ...
@@ -56,7 +56,7 @@ Working on the Lena image, the standard 2-D DTCWT achieves perfect reconstructio
 .. plot::
     :include-source: true
 
-    import dtcwt.backend.backend_numpy as backend
+    import dtcwt.numpy as backend
 
     # Use the standard 2-D DTCWT
     transform = backend.Transform2d(biort='near_sym_b', qshift='qshift_b')
@@ -80,7 +80,7 @@ Using the modified wavelets yields the following result:
 .. plot::
     :include-source: true
 
-    import dtcwt.backend.backend_numpy as backend
+    import dtcwt.numpy as backend
 
     # Use the modified 2-D DTCWT
     transform = backend.Transform2d(biort='near_sym_b_bp', qshift='qshift_b_bp')
diff --git a/dtcwt/__init__.py b/dtcwt/__init__.py
index 64e822e..70bf254 100644
--- a/dtcwt/__init__.py
+++ b/dtcwt/__init__.py
@@ -3,7 +3,13 @@ from .transform1d import dtwavexfm, dtwaveifm
 from .transform2d import dtwavexfm2, dtwaveifm2, dtwavexfm2b, dtwaveifm2b
 from .transform3d import dtwavexfm3, dtwaveifm3
 
+from .numpy import Transform2d, TransformDomainSignal, ReconstructedSignal
+
 __all__ = [
+    'Transform2d',
+    'TransformDomainSignal',
+    'ReconstructedSignal',
+
     'dtwavexfm',
     'dtwaveifm',
 
diff --git a/dtcwt/backend/__init__.py b/dtcwt/backend/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/dtcwt/backend/base.py b/dtcwt/backend/base.py
deleted file mode 100644
index 5ec05fa..0000000
--- a/dtcwt/backend/base.py
+++ /dev/null
@@ -1,96 +0,0 @@
-from dtcwt.utils import asfarray
-from dtcwt.defaults import DEFAULT_BIORT, DEFAULT_QSHIFT
-
-class TransformDomainSignal(object):
-    """A representation of a transform domain signal.
-
-    Backends are free to implement any class which respects this interface for
-    storing transform-domain signals. The inverse transform may accept a
-    backend-specific version of this class but should always accept any class
-    which corresponds to this interface.
-
-    .. py:attribute:: lowpass
-        
-        A NumPy-compatible array containing the coarsest scale lowpass signal.
-
-    .. py:attribute:: subbands
-        
-        A tuple where each element is the complex subband coefficients for
-        corresponding scales finest to coarsest.
-
-    .. py:attribute:: scales
-        
-        *(optional)* A tuple where each element is a NumPy-compatible array
-        containing the lowpass signal for corresponding scales finest to
-        coarsest. This is not required for the inverse and may be *None*.
-
-    """
-    def __init__(self, lowpass, subbands, scales=None):
-        self.lowpass = asfarray(lowpass)
-        self.subbands = tuple(asfarray(x) for x in subbands)
-        self.scales = tuple(asfarray(x) for x in scales) if scales is not None else None
-
-class ReconstructedSignal(object):
-    """
-    A representation of the reconstructed signal from the inverse transform. A
-    backend is free to implement their own version of this class providing it
-    corresponds to the interface documented.
-
-    .. py:attribute:: value
-
-        A NumPy-compatible array containing the reconstructed signal.
-
-    """
-    def __init__(self, value):
-        self.value = asfarray(value)
-
-class Transform2d(object):
-    """
-    An implementation of a 2D DT-CWT transformation. Backends must provide a
-    transform class which provides an interface compatible with this base
-    class.
-
-    :param biort: Level 1 wavelets to use. See :py:func:`biort`.
-    :param qshift: Level >= 2 wavelets to use. See :py:func:`qshift`.
-
-    If *biort* or *qshift* are strings, they are used as an argument to the
-    :py:func:`biort` or :py:func:`qshift` functions. Otherwise, they are
-    interpreted as tuples of vectors giving filter coefficients. In the *biort*
-    case, this should be (h0o, g0o, h1o, g1o). In the *qshift* case, this should
-    be (h0a, h0b, g0a, g0b, h1a, h1b, g1a, g1b).
-
-    In some cases the tuples may have more elements. This is used to represent
-    the :ref:`rot-symm-wavelets`.
-    
-    """
-    def __init__(self, biort=DEFAULT_BIORT, qshift=DEFAULT_QSHIFT):
-        raise NotImplementedError()
-
-    def forward(self, X, nlevels=3, include_scale=False):
-        """Perform a *n*-level DTCWT-2D decompostion on a 2D matrix *X*.
-
-        :param X: 2D real array
-        :param nlevels: Number of levels of wavelet decomposition
-
-        :returns: A :py:class:`dtcwt.backend.TransformDomainSignal` compatible object representing the transform-domain signal
-
-        """
-        raise NotImplementedError()
-
-    def inverse(self, td_signal, gain_mask=None):
-        """Perform an *n*-level dual-tree complex wavelet (DTCWT) 2D
-        reconstruction.
-
-        :param td_signal: A :py:class:`dtcwt.backend.TransformDomainSignal`-like class holding the transform domain representation to invert.
-        :param gain_mask: Gain to be applied to each subband.
-
-        :returns: A :py:class:`dtcwt.backend.ReconstructedSignal` compatible instance with the reconstruction.
-
-        The (*d*, *l*)-th element of *gain_mask* is gain for subband with direction
-        *d* at level *l*. If gain_mask[d,l] == 0, no computation is performed for
-        band (d,l). Default *gain_mask* is all ones. Note that both *d* and *l* are
-        zero-indexed.
-
-        """
-        raise NotImplementedError()
-
diff --git a/dtcwt/lowlevel.py b/dtcwt/lowlevel.py
index 355f1cf..7239fc7 100644
--- a/dtcwt/lowlevel.py
+++ b/dtcwt/lowlevel.py
@@ -1,4 +1,4 @@
-from dtcwt.backend.backend_numpy.lowlevel import LowLevelBackendNumPy
+from dtcwt.numpy.lowlevel import LowLevelBackendNumPy
 
 _BACKEND = LowLevelBackendNumPy()
 
diff --git a/dtcwt/backend/backend_numpy/__init__.py b/dtcwt/numpy/__init__.py
similarity index 67%
rename from dtcwt/backend/backend_numpy/__init__.py
rename to dtcwt/numpy/__init__.py
index 77691d4..c4641b8 100644
--- a/dtcwt/backend/backend_numpy/__init__.py
+++ b/dtcwt/numpy/__init__.py
@@ -4,7 +4,7 @@ be available.
 
 """
 
-from .transform2d import TransformDomainSignal, Transform2d
+from .transform2d import TransformDomainSignal, Transform2d, ReconstructedSignal
 
 __all__ = [
     'TransformDomainSignal',
diff --git a/dtcwt/backend/backend_numpy/lowlevel.py b/dtcwt/numpy/lowlevel.py
similarity index 100%
rename from dtcwt/backend/backend_numpy/lowlevel.py
rename to dtcwt/numpy/lowlevel.py
diff --git a/dtcwt/backend/backend_numpy/transform2d.py b/dtcwt/numpy/transform2d.py
similarity index 89%
rename from dtcwt/backend/backend_numpy/transform2d.py
rename to dtcwt/numpy/transform2d.py
index da92c5b..8f4ceb1 100644
--- a/dtcwt/backend/backend_numpy/transform2d.py
+++ b/dtcwt/numpy/transform2d.py
@@ -5,17 +5,59 @@ import logging
 
 from six.moves import xrange
 
-from dtcwt.backend.base import TransformDomainSignal, ReconstructedSignal, Transform2d as Transform2dBase
 from dtcwt.coeffs import biort as _biort, qshift as _qshift
 from dtcwt.defaults import DEFAULT_BIORT, DEFAULT_QSHIFT
 from dtcwt.utils import appropriate_complex_type_for, asfarray
 
-from dtcwt.backend.backend_numpy.lowlevel import LowLevelBackendNumPy
+from dtcwt.numpy.lowlevel import LowLevelBackendNumPy
 
 # Use the NumPy low-level backend
 _BACKEND = LowLevelBackendNumPy()
 
-class Transform2d(Transform2dBase):
+class TransformDomainSignal(object):
+    """A representation of a transform domain signal.
+
+    Backends are free to implement any class which respects this interface for
+    storing transform-domain signals. The inverse transform may accept a
+    backend-specific version of this class but should always accept any class
+    which corresponds to this interface.
+
+    .. py:attribute:: lowpass
+        
+        A NumPy-compatible array containing the coarsest scale lowpass signal.
+
+    .. py:attribute:: subbands
+        
+        A tuple where each element is the complex subband coefficients for
+        corresponding scales finest to coarsest.
+
+    .. py:attribute:: scales
+        
+        *(optional)* A tuple where each element is a NumPy-compatible array
+        containing the lowpass signal for corresponding scales finest to
+        coarsest. This is not required for the inverse and may be *None*.
+
+    """
+    def __init__(self, lowpass, subbands, scales=None):
+        self.lowpass = asfarray(lowpass)
+        self.subbands = tuple(asfarray(x) for x in subbands)
+        self.scales = tuple(asfarray(x) for x in scales) if scales is not None else None
+
+class ReconstructedSignal(object):
+    """
+    A representation of the reconstructed signal from the inverse transform. A
+    backend is free to implement their own version of this class providing it
+    corresponds to the interface documented.
+
+    .. py:attribute:: value
+
+        A NumPy-compatible array containing the reconstructed signal.
+
+    """
+    def __init__(self, value):
+        self.value = asfarray(value)
+
+class Transform2d(object):
     """
     An implementation of the 2D DT-CWT via NumPy. *biort* and *qshift* are the
     wavelets which parameterise the transform. Valid values are documented in
diff --git a/dtcwt/backend/backend_opencl/__init__.py b/dtcwt/opencl/__init__.py
similarity index 100%
rename from dtcwt/backend/backend_opencl/__init__.py
rename to dtcwt/opencl/__init__.py
diff --git a/dtcwt/backend/backend_opencl/lowlevel.py b/dtcwt/opencl/lowlevel.py
similarity index 100%
rename from dtcwt/backend/backend_opencl/lowlevel.py
rename to dtcwt/opencl/lowlevel.py
diff --git a/dtcwt/backend/backend_opencl/transform2d.py b/dtcwt/opencl/transform2d.py
similarity index 96%
rename from dtcwt/backend/backend_opencl/transform2d.py
rename to dtcwt/opencl/transform2d.py
index 4a50cac..54d2a54 100644
--- a/dtcwt/backend/backend_opencl/transform2d.py
+++ b/dtcwt/opencl/transform2d.py
@@ -7,12 +7,12 @@ from six.moves import xrange
 from dtcwt import biort as _biort, qshift as _qshift
 from dtcwt.defaults import DEFAULT_BIORT, DEFAULT_QSHIFT
 from dtcwt.utils import appropriate_complex_type_for, asfarray, memoize
-from dtcwt.backend.backend_opencl.lowlevel import colfilter, coldfilt, colifilt
-from dtcwt.backend.backend_opencl.lowlevel import axis_convolve, axis_convolve_dfilter, q2c
-from dtcwt.backend.backend_opencl.lowlevel import to_device, to_queue, to_array, empty
+from dtcwt.opencl.lowlevel import colfilter, coldfilt, colifilt
+from dtcwt.opencl.lowlevel import axis_convolve, axis_convolve_dfilter, q2c
+from dtcwt.opencl.lowlevel import to_device, to_queue, to_array, empty
 
-from dtcwt.backend.base import TransformDomainSignal, ReconstructedSignal
-from dtcwt.backend.backend_numpy import Transform2d as Transform2dNumPy
+from dtcwt.numpy import TransformDomainSignal, ReconstructedSignal
+from dtcwt.numpy import Transform2d as Transform2dNumPy
 
 try:
     from pyopencl.array import concatenate, Array as CLArray
diff --git a/dtcwt/plotting.py b/dtcwt/plotting.py
index d3df2a5..560e2a3 100644
--- a/dtcwt/plotting.py
+++ b/dtcwt/plotting.py
@@ -35,7 +35,7 @@ def overlay_quiver_DTCWT(image, vectorField, level, offset):
         :include-source: true
 
         import dtcwt.plotting as plotting
-        import dtcwt.backend.backend_numpy as backend
+        import dtcwt.numpy as backend
 
         lena = datasets.lena()
 
diff --git a/dtcwt/registration/numpybackend.py b/dtcwt/registration/numpybackend.py
index 0b82c73..662f09c 100644
--- a/dtcwt/registration/numpybackend.py
+++ b/dtcwt/registration/numpybackend.py
@@ -10,7 +10,7 @@ import itertools
 from six.moves import xrange
 
 import dtcwt
-from dtcwt.backend import backend_numpy
+import dtcwt.numpy
 import dtcwt.sampling
 import dtcwt.utils
 import numpy as np
@@ -102,7 +102,7 @@ def qtildematrices(t_ref, t_target, levels):
     :returns: a tuple of :math:`\tilde{Q}` matrices for each index in *levels*
 
     Both *t_ref* and *t_target* should be
-    :py:class:`dtcwt.backend.base.TransformDomainSignal`-compatible objects.
+    :py:class:`dtcwt.TransformDomainSignal`-compatible objects.
     Indices in *levels* are 0-based.
 
     The returned matrices are NxMx27 where NxM is the shape of the
@@ -246,7 +246,7 @@ def warptransform(t, avecs, levels, method=None):
     :param levels: a sequence of 0-based indices specifying which levels to act on
 
     *t* should be a
-    :py:class:`dtcwt.backend.base.TransformDomainSignal`-compatible instance.
+    :py:class:`dtcwt.TransformDomainSignal`-compatible instance.
 
     The *method* parameter is interpreted as in :py:func:`dtcwt.sampling.rescale` and
     is the sampling method used to resize *avecs* to *shape*.
@@ -265,7 +265,7 @@ def warptransform(t, avecs, levels, method=None):
         warped_subbands[l] = warphighpass(warped_subbands[l], avecs, method=method)
 
     # Clone the transform
-    return backend_numpy.TransformDomainSignal(t.lowpass, tuple(warped_subbands), t.scales)
+    return dtcwt.numpy.TransformDomainSignal(t.lowpass, tuple(warped_subbands), t.scales)
 
 def estimatereg(source, reference, regshape=None):
     """
@@ -275,7 +275,7 @@ def estimatereg(source, reference, regshape=None):
     :param reference: transformed reference image
 
     The *reference* and *source* parameters should support the same API as
-    :py:class:`dtcwt.backend.base.TransformDomainSignal`.
+    :py:class:`dtcwt.TransformDomainSignal`.
 
     The local affine distortion is estimated at at 8x8 pixel scales.
     Return a NxMx6 array where the 6-element vector at (N,M) corresponds to the
diff --git a/dtcwt/transform2d.py b/dtcwt/transform2d.py
index a1ca370..74208ee 100644
--- a/dtcwt/transform2d.py
+++ b/dtcwt/transform2d.py
@@ -10,8 +10,7 @@ from dtcwt.defaults import DEFAULT_BIORT, DEFAULT_QSHIFT
 from dtcwt.lowlevel import colfilter, coldfilt, colifilt
 from dtcwt.utils import appropriate_complex_type_for, asfarray
 
-from dtcwt.backend.base import TransformDomainSignal
-from dtcwt.backend.backend_numpy import Transform2d
+from dtcwt.numpy import Transform2d, TransformDomainSignal
 
 def dtwavexfm2(X, nlevels=3, biort=DEFAULT_BIORT, qshift=DEFAULT_QSHIFT, include_scale=False):
     """Perform a *n*-level DTCWT-2D decompostion on a 2D matrix *X*.
diff --git a/examples/image-registration.py b/examples/image-registration.py
index 3748b17..f5f5801 100755
--- a/examples/image-registration.py
+++ b/examples/image-registration.py
@@ -16,7 +16,7 @@ from matplotlib.pyplot import *
 import numpy as np
 
 import dtcwt
-from dtcwt.backend.backend_numpy import Transform2d
+from dtcwt.numpy import Transform2d
 import dtcwt.sampling
 from dtcwt.registration import *
 
diff --git a/examples/register_images.py b/examples/register_images.py
index 0017940..98dc9bf 100755
--- a/examples/register_images.py
+++ b/examples/register_images.py
@@ -18,8 +18,8 @@ import logging
 
 from docopt import docopt
 import dtcwt
-from dtcwt.backend.backend_opencl import Transform2d as CLTransform2d
-from dtcwt.backend.backend_numpy import Transform2d as NumPyTransform2d
+from dtcwt.opencl import Transform2d as CLTransform2d
+from dtcwt.numpy import Transform2d as NumPyTransform2d
 import dtcwt.registration as reg
 import dtcwt.sampling
 from PIL import Image # Use 'Pillow', the PIL fork
diff --git a/examples/register_video.py b/examples/register_video.py
index 4bc2cd0..16b0e79 100755
--- a/examples/register_video.py
+++ b/examples/register_video.py
@@ -18,7 +18,7 @@ import logging
 import cv2
 from docopt import docopt
 import dtcwt
-from dtcwt.backend.backend_numpy import Transform2d
+from dtcwt.numpy import Transform2d
 import dtcwt.registration as reg
 import dtcwt.sampling
 import numpy as np
diff --git a/scripts/benchmark_opencl.py b/scripts/benchmark_opencl.py
index 1fa2f5a..b9db840 100644
--- a/scripts/benchmark_opencl.py
+++ b/scripts/benchmark_opencl.py
@@ -12,7 +12,7 @@ import timeit
 import numpy as np
 
 from dtcwt.coeffs import biort, qshift
-from dtcwt.backend.backend_opencl.lowlevel import NoCLPresentError, get_default_queue
+from dtcwt.opencl.lowlevel import NoCLPresentError, get_default_queue
 
 lena = np.load(os.path.join(os.path.dirname(__file__), '..', 'tests', 'lena.npz'))['lena']
 h0o, g0o, h1o, g1o = biort('near_sym_b')
@@ -60,7 +60,7 @@ def main():
             'from dtcwt.lowlevel import colfilter; from __main__ import lena, h1o')
     print('Running OpenCL colfilter...')
     b = benchmark('colfilter(lena, h1o)',
-            'from dtcwt.backend.backend_opencl.lowlevel import colfilter; from __main__ import lena, h1o')
+            'from dtcwt.opencl.lowlevel import colfilter; from __main__ import lena, h1o')
     print('Speed up: x{0:.2f}'.format(a/b))
     print('=====')
 
@@ -69,7 +69,7 @@ def main():
             'from dtcwt.lowlevel import coldfilt; from __main__ import lena, h0b, h0a')
     print('Running OpenCL coldfilt...')
     b = benchmark('coldfilt(lena, h0b, h0a)',
-            'from dtcwt.backend.backend_opencl.lowlevel import coldfilt; from __main__ import lena, h0b, h0a')
+            'from dtcwt.opencl.lowlevel import coldfilt; from __main__ import lena, h0b, h0a')
     print('Speed up: x{0:.2f}'.format(a/b))
     print('=====')
 
@@ -78,7 +78,7 @@ def main():
             'from dtcwt.lowlevel import colifilt; from __main__ import lena, h0b, h0a')
     print('Running OpenCL colifilt...')
     b = benchmark('colifilt(lena, h0b, h0a)',
-            'from dtcwt.backend.backend_opencl.lowlevel import colifilt; from __main__ import lena, h0b, h0a')
+            'from dtcwt.opencl.lowlevel import colifilt; from __main__ import lena, h0b, h0a')
     print('Speed up: x{0:.2f}'.format(a/b))
     print('=====')
 
@@ -87,7 +87,7 @@ def main():
             'from dtcwt import dtwavexfm2; from __main__ import lena')
     print('Running OpenCL dtwavexfm2...')
     b = benchmark('dtwavexfm2(lena)',
-            'from dtcwt.backend.backend_opencl.transform2d import dtwavexfm2; from __main__ import lena')
+            'from dtcwt.opencl.transform2d import dtwavexfm2; from __main__ import lena')
     print('Speed up: x{0:.2f}'.format(a/b))
     print('=====')
 
@@ -96,7 +96,7 @@ def main():
             'from dtcwt import dtwavexfm2; from __main__ import lena')
     print('Running OpenCL dtwavexfm2 (non-POT)...')
     b = benchmark('dtwavexfm2(lena[:510,:480])',
-            'from dtcwt.backend.backend_opencl.transform2d import dtwavexfm2; from __main__ import lena')
+            'from dtcwt.opencl.transform2d import dtwavexfm2; from __main__ import lena')
     print('Speed up: x{0:.2f}'.format(a/b))
     print('=====')
 
diff --git a/tests/testopenclcoldfilt.py b/tests/testopenclcoldfilt.py
index d4b383d..c5ee603 100644
--- a/tests/testopenclcoldfilt.py
+++ b/tests/testopenclcoldfilt.py
@@ -2,7 +2,7 @@ import os
 
 import numpy as np
 from dtcwt.lowlevel import coldfilt as coldfilt_gold
-from dtcwt.backend.backend_opencl.lowlevel import coldfilt, NoCLPresentError
+from dtcwt.opencl.lowlevel import coldfilt, NoCLPresentError
 from dtcwt.coeffs import biort, qshift
 
 from nose.tools import raises
diff --git a/tests/testopenclcolfilter.py b/tests/testopenclcolfilter.py
index bb08795..d5c969b 100644
--- a/tests/testopenclcolfilter.py
+++ b/tests/testopenclcolfilter.py
@@ -2,7 +2,7 @@ import os
 
 import numpy as np
 from dtcwt import biort, qshift
-from dtcwt.backend.backend_opencl.lowlevel import colfilter
+from dtcwt.opencl.lowlevel import colfilter
 from dtcwt.lowlevel import colfilter as colfilter_gold
 
 from .util import assert_almost_equal, skip_if_no_cl
diff --git a/tests/testopenclcolifilt.py b/tests/testopenclcolifilt.py
index 6cea09e..de44bc5 100644
--- a/tests/testopenclcolifilt.py
+++ b/tests/testopenclcolifilt.py
@@ -1,7 +1,7 @@
 import os
 
 import numpy as np
-from dtcwt.backend.backend_opencl.lowlevel import colifilt
+from dtcwt.opencl.lowlevel import colifilt
 from dtcwt.lowlevel import colifilt as colifilt_gold
 from dtcwt.coeffs import biort, qshift
 
diff --git a/tests/testopenclxfm2.py b/tests/testopenclxfm2.py
index ab6254a..8e9d5b6 100644
--- a/tests/testopenclxfm2.py
+++ b/tests/testopenclxfm2.py
@@ -5,7 +5,7 @@ from nose.plugins.attrib import attr
 import numpy as np
 from dtcwt import biort, qshift
 from dtcwt import dtwavexfm2 as dtwavexfm2_np, dtwaveifm2
-from dtcwt.backend.backend_opencl.transform2d import dtwavexfm2 as dtwavexfm2_cl
+from dtcwt.opencl.transform2d import dtwavexfm2 as dtwavexfm2_cl
 
 from .util import assert_almost_equal, skip_if_no_cl
 import tests.datasets as datasets
diff --git a/tests/testregistration.py b/tests/testregistration.py
index f4a21d1..7a8b94a 100644
--- a/tests/testregistration.py
+++ b/tests/testregistration.py
@@ -3,7 +3,7 @@ import os
 import numpy as np
 
 import dtcwt
-from dtcwt.backend.backend_numpy import Transform2d
+from dtcwt.numpy import Transform2d
 from dtcwt.registration import *
 
 import tests.datasets as datasets
diff --git a/tests/util.py b/tests/util.py
index 0c86b49..586c23c 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -2,7 +2,7 @@ import functools
 import numpy as np
 
 from nose import SkipTest
-from dtcwt.backend.backend_opencl.lowlevel import NoCLPresentError
+from dtcwt.opencl.lowlevel import NoCLPresentError
 
 TOLERANCE = 1e-6
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-dtcwt.git



More information about the debian-science-commits mailing list