[python-dtcwt] 347/497: remove ReconstructedSignal
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 ae0e3254bea002e40908f9971b699a6f8ac734f7
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date: Fri Feb 7 12:56:12 2014 +0000
remove ReconstructedSignal
ReconstructedSignal was nothing more than a needless wrapper around a
numpy array. There's no need for it.
---
docs/variant.rst | 4 ++--
dtcwt/__init__.py | 3 +--
dtcwt/numpy/__init__.py | 2 +-
dtcwt/numpy/transform2d.py | 18 ++----------------
dtcwt/opencl/transform2d.py | 2 +-
dtcwt/transform2d.py | 2 +-
6 files changed, 8 insertions(+), 23 deletions(-)
diff --git a/docs/variant.rst b/docs/variant.rst
index ee90436..60b5abc 100644
--- a/docs/variant.rst
+++ b/docs/variant.rst
@@ -66,7 +66,7 @@ Working on the Lena image, the standard 2-D DTCWT achieves perfect reconstructio
image_t = transform.forward(image)
# Inverse transform
- Z = transform.inverse(image_t).value
+ Z = transform.inverse(image_t)
# Show the error
imshow(Z-image, cmap=cm.gray)
@@ -90,7 +90,7 @@ Using the modified wavelets yields the following result:
image_t = transform.forward(image)
# Inverse transform
- Z = transform.inverse(image_t).value
+ Z = transform.inverse(image_t)
# Show the error
imshow(Z-image, cmap=cm.gray)
diff --git a/dtcwt/__init__.py b/dtcwt/__init__.py
index 0e38839..194926a 100644
--- a/dtcwt/__init__.py
+++ b/dtcwt/__init__.py
@@ -1,7 +1,6 @@
-from .numpy import Transform2d, TransformDomainSignal, ReconstructedSignal
+from .numpy import Transform2d, TransformDomainSignal
__all__ = [
'Transform2d',
'TransformDomainSignal',
- 'ReconstructedSignal',
]
diff --git a/dtcwt/numpy/__init__.py b/dtcwt/numpy/__init__.py
index c4641b8..77691d4 100644
--- a/dtcwt/numpy/__init__.py
+++ b/dtcwt/numpy/__init__.py
@@ -4,7 +4,7 @@ be available.
"""
-from .transform2d import TransformDomainSignal, Transform2d, ReconstructedSignal
+from .transform2d import TransformDomainSignal, Transform2d
__all__ = [
'TransformDomainSignal',
diff --git a/dtcwt/numpy/transform2d.py b/dtcwt/numpy/transform2d.py
index 2acd381..21b487e 100644
--- a/dtcwt/numpy/transform2d.py
+++ b/dtcwt/numpy/transform2d.py
@@ -43,20 +43,6 @@ class TransformDomainSignal(object):
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
@@ -232,7 +218,7 @@ class Transform2d(object):
:param td_signal: A :py:class:`dtcwt.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.ReconstructedSignal` compatible instance with the reconstruction.
+ :returns: A numpy-array 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
@@ -330,7 +316,7 @@ class Transform2d(object):
# Do odd top-level filters on rows.
Z = (_BACKEND.colfilter(y1.T,g0o) + _BACKEND.colfilter(y2.T,g1o)).T
- return ReconstructedSignal(Z)
+ return Z
#==========================================================================================
# ********** INTERNAL FUNCTIONS **********
diff --git a/dtcwt/opencl/transform2d.py b/dtcwt/opencl/transform2d.py
index 70f64a9..ab253e7 100644
--- a/dtcwt/opencl/transform2d.py
+++ b/dtcwt/opencl/transform2d.py
@@ -11,7 +11,7 @@ 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.numpy import TransformDomainSignal, ReconstructedSignal
+from dtcwt.numpy import TransformDomainSignal
from dtcwt.numpy import Transform2d as Transform2dNumPy
try:
diff --git a/dtcwt/transform2d.py b/dtcwt/transform2d.py
index c2b26a8..4eaa971 100644
--- a/dtcwt/transform2d.py
+++ b/dtcwt/transform2d.py
@@ -86,7 +86,7 @@ def dtwaveifm2(Yl,Yh,biort=DEFAULT_BIORT,qshift=DEFAULT_QSHIFT,gain_mask=None):
"""
trans = Transform2d(biort, qshift)
res = trans.inverse(TransformDomainSignal(Yl, Yh), gain_mask=gain_mask)
- return res.value
+ return res
# BACKWARDS COMPATIBILITY: add a dtwave{i,x}fm2b function which is a copy of
# dtwave{i,x}fm2b. The functionality of the ...b variant is rolled into the
--
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