Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Please unblock package python-mdp

This version fixes FTBFS #768675. The fixes are cherry-picked from
upstream git repository. Every single commit has been incorporated
as a quilt patch. Two other bugs are fixed which were reported on
upstream user mailinglist: "Fix inclusion of CSS data in bimdp" and
"run tests from within a corresponding tests directory to work
around new py.test conftest.py autodiscovery features in python-pytest 
version 2.6.3". Documentation-only fixes are also included. The
Debian changelog entry explains everything:

  * New upstream git snapshot
    - resolves FTBFS by a workaround of faulty unicode encoding in
      sklearn docstrings (Closes: #768675). The corresponding
      commits in upstream git are the quilt patches:
      changeset_af5294f0b78ea5b20e4c1c23fc55a4bdaa0749c9.diff
      changeset_4fc2b74375701dcabde0e3368841ce31a52c4529.diff
      changeset_324cb9b963a7e9d1bb22b5934eaa9f17974f5b11.diff
    - Documentation fixes. The corresponding commits in upstream
      git are the quilt patches:
      changeset_f4a84b7186289027410abe116f5487f800869be2.diff
      changeset_4d05f0adafcc770277f36d30894a5c6aefe8a58b.diff
      changeset_2b1048b980748366dd6439317fccc99f728056a7.diff
      changeset_17202a65f7608e550c52953ef4026cf8fe623c16.diff
    - Fix inclusion of CSS data in bimdp. The corresponding commit
      in upstream git is the quilt patch:
      changeset_4ec2f2940fda4f4fec9db184dbb1b93053040159.diff
  * debian/rules
   - run tests from within a corresponding tests directory to work around
     new py.test conftest.py autodiscovery features in python-pytest 
     version 2.6.3

Src debdiff
diff -Nru mdp-3.3/debian/changelog mdp-3.3/debian/changelog
--- mdp-3.3/debian/changelog    2012-09-30 09:09:35.000000000 +0200
+++ mdp-3.3/debian/changelog    2014-11-28 16:45:30.000000000 +0100
@@ -1,3 +1,29 @@
+mdp (3.3-2) unstable; urgency=low
+
+  * New upstream git snapshot
+    - resolves FTBFS by a workaround of faulty unicode encoding in
+      sklearn docstrings (Closes: #768675). The corresponding
+      commits in upstream git are the quilt patches:
+      changeset_af5294f0b78ea5b20e4c1c23fc55a4bdaa0749c9.diff
+      changeset_4fc2b74375701dcabde0e3368841ce31a52c4529.diff
+      changeset_324cb9b963a7e9d1bb22b5934eaa9f17974f5b11.diff
+    - Documentation fixes. The corresponding commits in upstream
+      git are the quilt patches:
+      changeset_f4a84b7186289027410abe116f5487f800869be2.diff
+      changeset_4d05f0adafcc770277f36d30894a5c6aefe8a58b.diff
+      changeset_2b1048b980748366dd6439317fccc99f728056a7.diff
+      changeset_17202a65f7608e550c52953ef4026cf8fe623c16.diff
+    - Fix inclusion of CSS data in bimdp. The corresponding commit
+      in upstream git is the quilt patch:
+      changeset_4ec2f2940fda4f4fec9db184dbb1b93053040159.diff
+  * debian/rules
+   - run tests from within a corresponding tests directory to work around
+     new py.test conftest.py autodiscovery features in python-pytest 
+     version 2.6.3
+  * Upload sponsored by Yaroslav Halchenko
+
+ -- Tiziano Zito <opossumn...@gmail.com>  Wed, 12 Nov 2014 15:53:57 +0100
+
 mdp (3.3-1) unstable; urgency=low
 
   * New upstream bug-fix release
diff -Nru 
mdp-3.3/debian/patches/changeset_17202a65f7608e550c52953ef4026cf8fe623c16.diff 
mdp-3.3/debian/patches/changeset_17202a65f7608e550c52953ef4026cf8fe623c16.diff
--- 
mdp-3.3/debian/patches/changeset_17202a65f7608e550c52953ef4026cf8fe623c16.diff  
    1970-01-01 01:00:00.000000000 +0100
+++ 
mdp-3.3/debian/patches/changeset_17202a65f7608e550c52953ef4026cf8fe623c16.diff  
    2014-11-28 16:45:30.000000000 +0100
@@ -0,0 +1,54 @@
+From: Niko Wilbert <niko.wilb...@tngtech.com>
+Subject: DOC: some small updates and fixes in docstrings and comments
+
+Index: mdp-toolkit/bimdp/__init__.py
+===================================================================
+--- mdp-toolkit.orig/bimdp/__init__.py
++++ mdp-toolkit/bimdp/__init__.py
+@@ -42,11 +42,6 @@ This is described in more detail in the
+ 
+ ### T O D O ###
+ 
+-# ------------- optional ----------------
+-
+-# TODO: maybe also allow target==EXIT_TARGET during training
+-#     would have to modify _train_node_single_phase
+-
+ # TODO: add a target seperator that does not remove the key. Could use
+ #    -> remove key
+ #    --> remove one '-' on entry
+@@ -70,7 +65,7 @@ This is described in more detail in the
+ #    is in place.
+ 
+ # TODO: Implement more internal checks for node output result?
+-#    Check that last element is not None? Use assume?
++#    Check that last element is not None?
+ 
+ # TODO: implement switchlayer, a layer where each column represents a 
different
+ #    target, so the target value determines which nodes are used
+Index: mdp-toolkit/bimdp/binode.py
+===================================================================
+--- mdp-toolkit.orig/bimdp/binode.py
++++ mdp-toolkit/bimdp/binode.py
+@@ -60,8 +60,7 @@ keywords are treated in a special way:
+  'target' -- If any template method like execute finds a 'target' keyword in
+      the message then this is used as the target value in the return value.
+      However, if _execute then also returns a target value this overwrites the
+-     target value. In global_message calls 'target' has no special meaning and
+-     can be used like any other keyword.
++     target value.
+ 
+   'method' -- Specify the name of the method that should be used instead of
+       the standard one (e.g. in execute the standard method is _execute).
+Index: mdp-toolkit/bimdp/nodes/autogen.py
+===================================================================
+--- mdp-toolkit.orig/bimdp/nodes/autogen.py
++++ mdp-toolkit/bimdp/nodes/autogen.py
+@@ -1,7 +1,5 @@
+ """
+ Module to automatically create a module with BiMDP versions of MDP nodes.
+-
+-Run this module to overwrite the autogen_binodes module with a new version.
+ """
+ 
+ import inspect
diff -Nru 
mdp-3.3/debian/patches/changeset_2b1048b980748366dd6439317fccc99f728056a7.diff 
mdp-3.3/debian/patches/changeset_2b1048b980748366dd6439317fccc99f728056a7.diff
--- 
mdp-3.3/debian/patches/changeset_2b1048b980748366dd6439317fccc99f728056a7.diff  
    1970-01-01 01:00:00.000000000 +0100
+++ 
mdp-3.3/debian/patches/changeset_2b1048b980748366dd6439317fccc99f728056a7.diff  
    2014-11-28 16:45:30.000000000 +0100
@@ -0,0 +1,23 @@
+From: Alberto Escalante <alberto.nicolas.escala...@gmail.com>
+Subject: DOC: indicated what expansion failed in the tests of 
GeneralExpansionNode
+
+Index: mdp-toolkit/mdp/test/test_GeneralExpansionNode.py
+===================================================================
+--- mdp-toolkit.orig/mdp/test/test_GeneralExpansionNode.py
++++ mdp-toolkit/mdp/test/test_GeneralExpansionNode.py
+@@ -21,12 +21,12 @@ def testGeneralExpansionNode():
+     input = numx.random.normal(size=(samples, input_dim))
+     out = cen.execute(input)
+     assert_array_almost_equal(out[:, 0:input_dim], input,
+-                              6, "incorrect constant expansion")
++                              6, "incorrect identity expansion")
+     assert_array_almost_equal(out[:, input_dim:2*input_dim],
+-                              input ** 2, 6, "incorrect constant expansion")
++                              input ** 2, 6, "incorrect squares expansion")
+     assert_array_almost_equal(out[:, 2*input_dim:],
+                               dumb_quadratic_expansion(input), 6,
+-                              "incorrect constant expansion")
++                              "incorrect quadratic expansion")
+     assert cen.expanded_dim(input_dim) == 2 * input_dim + input_dim**2, 
"expanded_dim failed"
+     assert_array_almost_equal(cen.output_sizes(input_dim),
+                               numx.array([input_dim, input_dim,
diff -Nru 
mdp-3.3/debian/patches/changeset_324cb9b963a7e9d1bb22b5934eaa9f17974f5b11.diff 
mdp-3.3/debian/patches/changeset_324cb9b963a7e9d1bb22b5934eaa9f17974f5b11.diff
--- 
mdp-3.3/debian/patches/changeset_324cb9b963a7e9d1bb22b5934eaa9f17974f5b11.diff  
    1970-01-01 01:00:00.000000000 +0100
+++ 
mdp-3.3/debian/patches/changeset_324cb9b963a7e9d1bb22b5934eaa9f17974f5b11.diff  
    2014-11-28 16:45:30.000000000 +0100
@@ -0,0 +1,18 @@
+From: Pietro Berkes <pber...@enthought.com>
+Subject: FIX: cStringIO does not support Unicode
+  `autogen` was breaking in nodes with Unicode characters in their docstring. 
We
+traced this down to cStringIO, which unlike StringIO does not support unicode.
+
+Index: mdp-toolkit/bimdp/nodes/autogen.py
+===================================================================
+--- mdp-toolkit.orig/bimdp/nodes/autogen.py
++++ mdp-toolkit/bimdp/nodes/autogen.py
+@@ -6,7 +6,7 @@ Run this module to overwrite the autogen
+ 
+ import inspect
+ import mdp
+-from cStringIO import StringIO
++from StringIO import StringIO
+ 
+ # Blacklist of nodes that cause problems with autogeneration
+ NOAUTOGEN_MDP_NODES = [
diff -Nru 
mdp-3.3/debian/patches/changeset_4d05f0adafcc770277f36d30894a5c6aefe8a58b.diff 
mdp-3.3/debian/patches/changeset_4d05f0adafcc770277f36d30894a5c6aefe8a58b.diff
--- 
mdp-3.3/debian/patches/changeset_4d05f0adafcc770277f36d30894a5c6aefe8a58b.diff  
    1970-01-01 01:00:00.000000000 +0100
+++ 
mdp-3.3/debian/patches/changeset_4d05f0adafcc770277f36d30894a5c6aefe8a58b.diff  
    2014-11-28 16:45:30.000000000 +0100
@@ -0,0 +1,57 @@
+From: Alberto Escalante <alberto.nicolas.escala...@gmail.com>
+Subject: FIX: made code and documentation consistent regarding the parameter k 
in invert_exp_funcs2
+
+Index: mdp-toolkit/mdp/nodes/expansion_nodes.py
+===================================================================
+--- mdp-toolkit.orig/mdp/nodes/expansion_nodes.py
++++ mdp-toolkit/mdp/nodes/expansion_nodes.py
+@@ -343,7 +343,7 @@ class GeneralExpansionNode(_ExpansionNod
+                                                     self.input_dim,
+                                                     self.funcs,
+                                                     use_hint=use_hint,
+-                                                    k=0.001)
++                                                    k=0.000001)
+             return app_x_2.astype(self.dtype)
+         except NotImplementedError, exc:
+             raise mdp.MDPException(exc)
+Index: mdp-toolkit/mdp/utils/routines.py
+===================================================================
+--- mdp-toolkit.orig/mdp/utils/routines.py
++++ mdp-toolkit/mdp/utils/routines.py
+@@ -422,19 +422,19 @@ def gabor(size, alpha, phi, freq, sgm, x
+ 
+ def residuals(app_x, y_noisy, exp_funcs, x_orig, k=0.0):
+     """Function used internally by invert_exp_funcs2 to approximate
+-    inverses in ConstantExpansionNode. """
+-    app_x = app_x.reshape((1,len(app_x)))
++    inverses in GeneralExpansionNode. """
++    app_x = app_x.reshape((1,-1))
+     app_exp_x =  numx.concatenate([func(app_x) for func in exp_funcs],axis=1)
+ 
+     div_y = numx.sqrt(len(y_noisy))
+-    div_x = numx.sqrt(len(x_orig))
+-    return numx.append( (1-k)*(y_noisy-app_exp_x[0]) / div_y, k * (x_orig - 
app_x[0])/div_x )
++    div_x = numx.sqrt(len(x_orig))  
++    return numx.append( (1-k)**0.5 *(y_noisy-app_exp_x[0]) / div_y, (k)**0.5 
* (x_orig - app_x[0])/div_x )
+ 
+ def invert_exp_funcs2(exp_x_noisy, dim_x, exp_funcs, use_hint=False, k=0.0):
+     """Approximates a preimage app_x of exp_x_noisy.
+ 
+-    Returns an array app_x, such that each row of exp_x_noisy is close
+-    to each row of exp_funcs(app_x).
++    Returns an array app_x, such that each row of exp_funcs(app_x) is close
++    to each row of exp_x_noisy.
+ 
+     use_hint: determines the starting point for the approximation of the
+     preimage. There are three possibilities.
+@@ -445,8 +445,8 @@ def invert_exp_funcs2(exp_x_noisy, dim_x
+     k: weighting factor in [0, 1] to balance between approximation error and
+        closeness to the starting point. For instance:
+        objective function is to minimize:
+-           (1-k) * |exp_funcs(app_x) - exp_x_noisy|/output_dim +
+-               k * |app_x - starting point|/input_dim
++           (1-k) * ||exp_funcs(app_x) - exp_x_noisy||**2/output_dim +
++               k * ||app_x - starting point||**2/input_dim
+ 
+     Note: this function requires scipy.
+     """
diff -Nru 
mdp-3.3/debian/patches/changeset_4ec2f2940fda4f4fec9db184dbb1b93053040159.diff 
mdp-3.3/debian/patches/changeset_4ec2f2940fda4f4fec9db184dbb1b93053040159.diff
--- 
mdp-3.3/debian/patches/changeset_4ec2f2940fda4f4fec9db184dbb1b93053040159.diff  
    1970-01-01 01:00:00.000000000 +0100
+++ 
mdp-3.3/debian/patches/changeset_4ec2f2940fda4f4fec9db184dbb1b93053040159.diff  
    2014-11-28 16:45:30.000000000 +0100
@@ -0,0 +1,16 @@
+From: Niko Wilbert <m...@nikowilbert.de>
+Subject: FIX: fixed broken inclusion of CSS data
+
+Index: mdp-toolkit/bimdp/hinet/bihtmlvisitor.py
+===================================================================
+--- mdp-toolkit.orig/bimdp/hinet/bihtmlvisitor.py
++++ mdp-toolkit/bimdp/hinet/bihtmlvisitor.py
+@@ -108,7 +108,7 @@ def show_biflow(flow, filename=None, tit
+         html_file = open(filename, 'w')
+     html_file.write('<html>\n<head>\n<title>%s</title>\n' % title)
+     html_file.write('<style type="text/css" media="screen">')
+-    html_file.write(mdp.utils.BASIC_STYLE)
++    html_file.write(mdp.utils.basic_css())
+     html_file.write(BiHiNetHTMLVisitor.hinet_css())
+     html_file.write('</style>\n</head>\n<body>\n')
+     html_file.write('<h3>%s</h3>\n' % title)
diff -Nru 
mdp-3.3/debian/patches/changeset_4fc2b74375701dcabde0e3368841ce31a52c4529.diff 
mdp-3.3/debian/patches/changeset_4fc2b74375701dcabde0e3368841ce31a52c4529.diff
--- 
mdp-3.3/debian/patches/changeset_4fc2b74375701dcabde0e3368841ce31a52c4529.diff  
    1970-01-01 01:00:00.000000000 +0100
+++ 
mdp-3.3/debian/patches/changeset_4fc2b74375701dcabde0e3368841ce31a52c4529.diff  
    2014-11-28 16:45:30.000000000 +0100
@@ -0,0 +1,162 @@
+From: Niko Wilbert <niko.wilb...@tngtech.com>
+Subject: FIX: hacky fix for the unicode issue in bimdp autogen (fix for Bug 
#11)
+
+Index: mdp-toolkit/bimdp/nodes/autogen.py
+===================================================================
+--- mdp-toolkit.orig/bimdp/nodes/autogen.py
++++ mdp-toolkit/bimdp/nodes/autogen.py
+@@ -14,6 +14,7 @@ NOAUTOGEN_MDP_NODES = [
+ ]
+ NOAUTOGEN_MDP_CLASSIFIERS = []
+ 
++
+ def _get_node_subclasses(node_class=mdp.Node, module=mdp.nodes):
+     """
+     Return all node classes in module which are subclasses of node_class.
+@@ -25,14 +26,15 @@ def _get_node_subclasses(node_class=mdp.
+             node_subclasses.append(node_subclass)
+     return node_subclasses
+ 
+-def _binode_code(fid, node_class, modulename, base_classname="BiNode",
++
++def _binode_code(write, node_class, modulename, base_classname="BiNode",
+                  old_classname="Node"):
+     """Write code for BiMDP versions of normal node classes into module file.
+     
+     It preserves the signature, which is useful for introspection (this is
+     used by the ParallelNode _default_fork implementation).
+ 
+-    fid -- File handle of the module file.
++    write -- Function to write out code.
+     node_class -- Node class for which the new node class will be created.
+     modulename -- Name of the module where the node is from.
+     base_classname -- Base class to be used for the new nodes.
+@@ -41,11 +43,11 @@ def _binode_code(fid, node_class, module
+     """
+     node_name = node_class.__name__
+     binode_name = node_name[:-len(old_classname)] + base_classname
+-    fid.write('class %s(%s, %s.%s):' %
+-              (binode_name, base_classname, modulename, node_name))
++    write('class %s(%s, %s.%s):' %
++          (binode_name, base_classname, modulename, node_name))
+     docstring = ("Automatically created %s version of %s." %
+                  (base_classname, node_name))
+-    fid.write('\n    """%s"""' % docstring)
++    write('\n    """%s"""' % docstring)
+     ## define the init method explicitly to preserve the signature
+     docstring = node_class.__init__.__doc__
+     args, varargs, varkw, defaults = inspect.getargspec(node_class.__init__)
+@@ -55,36 +57,37 @@ def _binode_code(fid, node_class, module
+     if defaults is None:
+         defaults = []
+     first_default = len(args) - len(defaults)
+-    fid.write('\n    def __init__(self')
+-    fid.write(''.join(', ' + arg for arg in args[:-len(defaults)]))
+-    fid.write(''.join(', ' + arg + '=' + repr(defaults[i_arg])
+-                      for i_arg, arg in enumerate(args[first_default:])))
++    write('\n    def __init__(self')
++    write(''.join(', ' + arg for arg in args[:-len(defaults)]))
++    write(''.join(', ' + arg + '=' + repr(defaults[i_arg])
++                  for i_arg, arg in enumerate(args[first_default:])))
+     if varargs:
+-        fid.write(', *%s' % varargs)
+-    # always support kwargs, to prevent multiple-inheritance issues 
++        write(', *%s' % varargs)
++    # always support kwargs, to prevent multiple-inheritance issues
+     if not varkw:
+         varkw = "kwargs"
+-    fid.write(', **%s' % varkw)
+-    fid.write('):')
++    write(', **%s' % varkw)
++    write('):')
+     if docstring:
+-        fid.write('\n        """%s"""' % docstring)
+-    fid.write('\n        super(%s, self).__init__(' % binode_name)
+-    fid.write(', '.join('%s=%s' % (arg, arg) for arg in args))
++        write('\n        """%s"""' % docstring)
++    write('\n        super(%s, self).__init__(' % binode_name)
++    write(', '.join('%s=%s' % (arg, arg) for arg in args))
+     if varargs:
+         if args:
+-            fid.write(', ')
+-        fid.write('*%s' % varargs)
++            write(', ')
++        write('*%s' % varargs)
+     if args or varargs:
+-        fid.write(', ')
+-    fid.write('**%s' % varkw)
+-    fid.write(')\n\n')
++        write(', ')
++    write('**%s' % varkw)
++    write(')\n\n')
+ 
+-def _binode_module(fid, node_classes, modulename="mdp.nodes",
++
++def _binode_module(write, node_classes, modulename="mdp.nodes",
+                    base_classname="BiNode", old_classname="Node",
+                    base_import="from bimdp import BiNode"):
+     """Write code for BiMDP versions of normal node classes into module file.
+ 
+-    fid -- File handle of the module file.
++    write -- Function to write out code.
+     node_classes -- List of node classes for which binodes are created.
+     modulename -- Name of the module where the node is from.
+     base_classname -- Base class to be used for the new nodes.
+@@ -92,15 +95,25 @@ def _binode_module(fid, node_classes, mo
+         in the new class name.
+     base_import -- Inmport line for the base_class.
+     """
+-    fid.write('"""\nAUTOMATICALLY GENERATED CODE, DO NOT MODIFY!\n\n')
+-    fid.write('Edit and run autogen.py instead to overwrite this 
module.\n"""')
+-    fid.write('\n\nimport %s\n' % modulename)
+-    fid.write(base_import + '\n\n')
++    write('"""\nAUTOMATICALLY GENERATED CODE, DO NOT MODIFY!\n\n')
++    write('Edit and run autogen.py instead to overwrite this module.\n"""')
++    write('\n\nimport %s\n' % modulename)
++    write(base_import + '\n\n')
+     for node_class in node_classes:
+-        _binode_code(fid, node_class, modulename,
++        _binode_code(write, node_class, modulename,
+                      base_classname=base_classname,
+                      old_classname=old_classname)
+-        
++
++
++def _get_unicode_write(fid):
++    def write(txt):
++        if type(txt) is unicode:
++            fid.write(txt)
++        else:
++            fid.write(unicode(txt, encoding='utf-8'))
++    return write
++
++
+ def binodes_code():
+     """Generate and import the BiNode wrappers for MDP Nodes."""
+     fid = StringIO()
+@@ -108,17 +121,23 @@ def binodes_code():
+                 _get_node_subclasses(node_class=mdp.Node, module=mdp.nodes)
+              if not issubclass(node, mdp.ClassifierNode) and
+                  node.__name__ not in NOAUTOGEN_MDP_NODES)
+-    _binode_module(fid, nodes)
++    _binode_module(_get_unicode_write(fid), nodes)
+     return fid.getvalue()
+     
+ def biclassifiers_code():
+     """Generate and import the BiClassifier wrappers for ClassifierNodes."""
+     fid = StringIO()
++    def write(txt):
++        if type(txt) is unicode:
++            fid.write(txt)
++        else:
++            fid.write(unicode(txt, encoding='utf-8'))
+     nodes = (node for node in
+                 _get_node_subclasses(node_class=mdp.ClassifierNode,
+                                      module=mdp.nodes)
+              if node.__name__ not in NOAUTOGEN_MDP_CLASSIFIERS)
+-    _binode_module(fid, nodes, base_classname="BiClassifier",
++    _binode_module(_get_unicode_write(fid), nodes,
++                   base_classname="BiClassifier",
+                    old_classname="Classifier",
+                    base_import="from bimdp import BiClassifier")
+     return fid.getvalue()
diff -Nru 
mdp-3.3/debian/patches/changeset_af5294f0b78ea5b20e4c1c23fc55a4bdaa0749c9.diff 
mdp-3.3/debian/patches/changeset_af5294f0b78ea5b20e4c1c23fc55a4bdaa0749c9.diff
--- 
mdp-3.3/debian/patches/changeset_af5294f0b78ea5b20e4c1c23fc55a4bdaa0749c9.diff  
    1970-01-01 01:00:00.000000000 +0100
+++ 
mdp-3.3/debian/patches/changeset_af5294f0b78ea5b20e4c1c23fc55a4bdaa0749c9.diff  
    2014-11-28 16:45:30.000000000 +0100
@@ -0,0 +1,26 @@
+From: Tiziano Zito <opossumn...@gmail.com>
+Subject: FIX: wrap sklearn algs in modules ending with "_"
+  For historical reasons we were not wrapping sklearn algs in modules with 
names
+ending with "_". This restriction prevented us from wrapping algs that we could
+have wrapped. We lift it now, since it does not seem to have any bad side
+effects anymore. A proper validation would be to really test that we can run 
the
+algs.
+
+Index: mdp-toolkit/mdp/nodes/scikits_nodes.py
+===================================================================
+--- mdp-toolkit.orig/mdp/nodes/scikits_nodes.py
++++ mdp-toolkit/mdp/nodes/scikits_nodes.py
+@@ -174,10 +174,9 @@ def apply_to_scikits_algorithms(current_
+             if (inspect.isclass(member) and
+                 member not in processed_classes):
+                 processed_classes.append(member)
+-                if ((hasattr(member, 'fit')
+-                     or hasattr(member, 'predict')
+-                     or hasattr(member, 'transform'))
+-                    and not member.__module__.endswith('_')):
++                if (hasattr(member, 'fit')
++                    or hasattr(member, 'predict')
++                    or hasattr(member, 'transform')):
+                     action(member)
+ 
+             # other modules
diff -Nru 
mdp-3.3/debian/patches/changeset_f4a84b7186289027410abe116f5487f800869be2.diff 
mdp-3.3/debian/patches/changeset_f4a84b7186289027410abe116f5487f800869be2.diff
--- 
mdp-3.3/debian/patches/changeset_f4a84b7186289027410abe116f5487f800869be2.diff  
    1970-01-01 01:00:00.000000000 +0100
+++ 
mdp-3.3/debian/patches/changeset_f4a84b7186289027410abe116f5487f800869be2.diff  
    2014-11-28 16:45:30.000000000 +0100
@@ -0,0 +1,85 @@
+From: Alberto Escalante <alberto.nicolas.escala...@gmail.com>
+Subject: DOC: added an example to GeneralExpansionNode and made the 
documentation more explicit
+
+Index: mdp-toolkit/mdp/nodes/expansion_nodes.py
+===================================================================
+--- mdp-toolkit.orig/mdp/nodes/expansion_nodes.py
++++ mdp-toolkit/mdp/nodes/expansion_nodes.py
+@@ -283,14 +283,38 @@ class GrowingNeuralGasExpansionNode(Grow
+ 
+ 
+ class GeneralExpansionNode(_ExpansionNode):
+-    """Expands the input signal x according to a list [f_0, ... f_k]
+-    of functions.
+-
+-    Each function f_i should take the whole two-dimensional array x as input 
and
+-    output another two-dimensional array. Moreover the output dimension should
+-    depend only on the input dimension.
+-    The output of the node is [f_0[x], ... f_k[x]], that is, the concatenation
+-    of each one of the outputs f_i[x].
++    """Expands the input samples by applying to them one or more functions 
provided.
++    
++    The functions to be applied are specified by a list [f_0, ..., f_k], 
where 
++    f_i, for 0 <= i <= k, denotes a particular function. 
++    The input data given to these functions is a two-dimensional array and
++    the output is another two-dimensional array. The dimensionality of the 
output 
++    should depend only on the dimensionality of the input.
++    Given a two-dimensional input array x, the output of the node 
++    is then [f_0(x), ..., f_k(x)], that is, the concatenation of each one of 
++    the computed arrays f_i(x).
++
++    This node has been designed to facilitate nonlinear, fixed but arbitrary  
++    transformations of the data samples within MDP flows.
++        
++    **Example**::
++   
++        >>> import mdp
++        >>> from mdp import numx
++        
++        >>> def identity(x): return x
++        
++        >>> def u3(x): return numx.absolute(x)**3 #A simple nonlinear 
transformation
++        
++        >>> def norm2(x): #Computes the norm of each sample returning an Nx1 
array
++        >>>     return ((x**2).sum(axis=1)**0.5).reshape((-1,1)) 
++          
++        >>> x = numx.array([[-2., 2.], [0.2, 0.3], [0.6, 1.2]])
++        >>> gen = mdp.nodes.GeneralExpansionNode(funcs=[identity, u3, norm2])
++        >>> print(gen.execute(x))
++        >>> [[-2.          2.          8.          8.          2.82842712]
++        >>>  [ 0.2         0.3         0.008       0.027       0.36055513]
++        >>>  [ 0.6         1.2         0.216       1.728       1.34164079]]
+ 
+     Original code contributed by Alberto Escalante.
+     """
+@@ -299,7 +323,7 @@ class GeneralExpansionNode(_ExpansionNod
+         Short argument description:
+ 
+           ``funcs``
+-               list of functions f_i that realize the expansion
++               list of functions f_i that realize the expansion.
+         """
+         self.funcs = funcs
+         super(GeneralExpansionNode, self).__init__(input_dim, dtype)
+@@ -312,7 +336,7 @@ class GeneralExpansionNode(_ExpansionNod
+     
+     def output_sizes(self, n):
+         """Return the individual output sizes of each expansion function
+-        when the input has lenght n"""
++        when the input has lenght n."""
+         sizes = numx.zeros(len(self.funcs))
+         x = numx.zeros((1,n))
+         for i, func in enumerate(self.funcs):
+@@ -333,8 +357,10 @@ class GeneralExpansionNode(_ExpansionNod
+         scipy.optimize.
+ 
+         ``use_hint``
+-               when calculating the pseudo inverse of the expansion,
+-               the hint determines the starting point for the approximation
++               when calculating a pseudo inverse of the expansion,
++               the hint determines the starting point for the approximation.
++               For details on this parameter see the function 
++               ``invert_exp_funcs2`` in ``mdp.utils.routines.py``.
+ 
+         This method requires scipy."""
+ 
diff -Nru mdp-3.3/debian/patches/series mdp-3.3/debian/patches/series
--- mdp-3.3/debian/patches/series       2012-09-28 17:26:53.000000000 +0200
+++ mdp-3.3/debian/patches/series       2014-11-28 16:45:30.000000000 +0100
@@ -1 +1,9 @@
 
+changeset_4ec2f2940fda4f4fec9db184dbb1b93053040159.diff
+changeset_4fc2b74375701dcabde0e3368841ce31a52c4529.diff
+changeset_17202a65f7608e550c52953ef4026cf8fe623c16.diff
+changeset_324cb9b963a7e9d1bb22b5934eaa9f17974f5b11.diff
+changeset_af5294f0b78ea5b20e4c1c23fc55a4bdaa0749c9.diff
+changeset_4d05f0adafcc770277f36d30894a5c6aefe8a58b.diff
+changeset_2b1048b980748366dd6439317fccc99f728056a7.diff
+changeset_f4a84b7186289027410abe116f5487f800869be2.diff
diff -Nru mdp-3.3/debian/rules mdp-3.3/debian/rules
--- mdp-3.3/debian/rules        2012-09-28 17:26:53.000000000 +0200
+++ mdp-3.3/debian/rules        2014-11-28 16:45:30.000000000 +0100
@@ -34,7 +34,8 @@
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
        set -xe && for v in $(PYTHONALL); do \
          LOC=$(INSTALLPATH)$(call py_libdir_sh, $$v); \
-         python$$v $$LOC/mdp/test/run_tests.py --seed $(RSEED) $$LOC/mdp 
$$LOC/bimdp; \
+         cd $$LOC/mdp/test   && python$$v $$LOC/mdp/test/run_tests.py --seed 
$(RSEED) && \
+         cd $$LOC/bimdp/test && python$$v $$LOC/mdp/test/run_tests.py --seed 
$(RSEED) ; \
        done
        : # Prune compiled code which could have been generated during testing
        find \( -name __pycache__ -o -name \*.pyc -o -name \*.egg-info \) 
-delete


unblock python-mdp/3.3-2

-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.17-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to