--- mdp-2.6.orig/debian/watch +++ mdp-2.6/debian/watch @@ -0,0 +1,7 @@ +# Compulsory line, this is a version 3 file +version=3 + +# Rely on numerical ID of the project +http://sourceforge.net/project/showfiles.php?group_id=116959&package_id=127225 .*MDP-([\d\.]+)\.tar\.gz.* + + --- mdp-2.6.orig/debian/docs +++ mdp-2.6/debian/docs @@ -0,0 +1,3 @@ +README +TODO +NEW_DEVELOPER_INFO.txt --- mdp-2.6.orig/debian/copyright +++ mdp-2.6/debian/copyright @@ -0,0 +1,42 @@ +This package was debianized by Yaroslav Halchenko on +Sat, 19 Jan 2008 16:41:20 -0500. + +It was downloaded from http://mdp-toolkit.sourceforge.net + +Upstream Authors: + + Pietro Berkes + Rike-Benjamin Schuppner , + Niko Wilbert + Tiziano Zito + +Copyright: + + 2003-2010, Pietro Berkes , + Rike-Benjamin Schuppner , + Niko Wilbert , and + Tiziano Zito + +License: + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this package; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA, or see + +On Debian systems, the complete text of the GNU Lesser General +Public License can be found in `/usr/share/common-licenses/LGPL-3'. + +The Debian packaging is (C) 2008-2010, Yaroslav Halchenko + and is licensed under the same license as +upstream sources. --- mdp-2.6.orig/debian/control +++ mdp-2.6/debian/control @@ -0,0 +1,22 @@ +Source: mdp +Section: python +Priority: optional +Maintainer: Yaroslav Halchenko +Build-Depends: cdbs (>=0.4.49), debhelper (>= 5.0.38), python-support (>= 0.6), python-all +Standards-Version: 3.8.4 +Vcs-Browser: http://git.onerussian.com/?p=deb/mdp.git +Vcs-git: http://git.onerussian.com/vcs/deb/mdp.git +Homepage: http://mdp-toolkit.sourceforge.net/ + +Package: python-mdp +Architecture: all +Depends: ${misc:Depends}, ${python:Depends}, python-numpy +Recommends: python-scipy, python-shogun-modular, python-libsvm +Suggests: python-pp +Enhances: python-mvpa +Description: Modular toolkit for Data Processing + Python data processing framework. Implemented algorithms include: + Principal Component Analysis (PCA), Independent Component Analysis + (ICA), Slow Feature Analysis (SFA), Independent Slow Feature Analysis (ISFA), + Growing Neural Gas (GNG), Factor Analysis, Fisher Discriminant Analysis (FDA), + and Gaussian Classifiers. --- mdp-2.6.orig/debian/rules +++ mdp-2.6/debian/rules @@ -0,0 +1,9 @@ +#!/usr/bin/make -f + +DEB_PYTHON_SYSTEM=pysupport + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/python-distutils.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk + +DEB_INSTALL_CHANGELOGS_ALL := CHANGES --- mdp-2.6.orig/debian/pycompat +++ mdp-2.6/debian/pycompat @@ -0,0 +1 @@ +2 --- mdp-2.6.orig/debian/changelog +++ mdp-2.6/debian/changelog @@ -0,0 +1,71 @@ +mdp (2.6-1) unstable; urgency=low + + * New upstream release -- thanks! Absorbed 5 patches from upstream git which + were done post-release to address issues which came up during packaging + * Adding upstream's git as the source remote for upstream sources + * Switching license for Debian packaging to match upstream license + (was under GPL before whenever upstream is LGPL) + * Updated upstream's copyright (new member and new years) + * Recommends python-shogun-modular and python-libsvm, + and Enhances python-mvpa + * Boosted policy complience to 3.8.4 (no additional changes) + * Ship upstream's CHANGES as a changelog, NEW_DEVELOPER_INFO.txt in docs. + + -- Yaroslav Halchenko Fri, 14 May 2010 17:26:53 -0400 + +mdp (2.5-1) unstable; urgency=low + + * New Upstream Version: can use symeig accepted as a part of scipy package, + python-symeig is obsolete now, so mdp recommends scipy now + * Boosted policy complience to 3.8.1 (no changes needed) + * Added ${misc:Depends} to Depends (thanks lintian) + + -- Yaroslav Halchenko Tue, 30 Jun 2009 18:45:46 -0400 + +mdp (2.4+svn20081126-1) unstable; urgency=low + + * New Upstream Upstream Version + SVN snapshot since (Closes: #487939) + * Suggests python-pp (tandem with pp is still alpha/unstable, thus only + in suggests) + + -- Yaroslav Halchenko Tue, 28 Oct 2008 13:48:02 -0400 + +mdp (2.3+svn20080720-1) unstable; urgency=low + + * New Upstream Version + * Boosted policy complience to 3.8.0 (no changes needed) + + -- Yaroslav Halchenko Sun, 20 Jul 2008 11:37:39 -0400 + +mdp (2.3+svn20080515-3) UNRELEASED; urgency=low + + * Adjusted vcs paths in the header + + -- Yaroslav Halchenko Thu, 17 Jul 2008 11:23:24 -0400 + +mdp (2.3+svn20080515-2) unstable; urgency=low + + * Recommends symeig + * Fixed copyright file with correct years + + -- Yaroslav Halchenko Fri, 30 May 2008 09:38:35 -0400 + +mdp (2.3+svn20080515-1) unstable; urgency=low + + * New Upstream Version + + -- Yaroslav Halchenko Thu, 15 May 2008 14:28:29 -0400 + +mdp (2.2+svn20080321-1) unstable; urgency=low + + * New Upstream Version + * Temporarily modified debian/watch to overcome problem with sf.net redirector + + -- Yaroslav Halchenko Fri, 21 Mar 2008 16:59:48 -0400 + +mdp (2.1+svn20080122-1) unstable; urgency=low + + * Initial release (Closes: #461634) + + -- Yaroslav Halchenko Sat, 19 Jan 2008 16:41:20 -0500 + --- mdp-2.6.orig/debian/pyversions +++ mdp-2.6/debian/pyversions @@ -0,0 +1 @@ +2.4- --- mdp-2.6.orig/debian/compat +++ mdp-2.6/debian/compat @@ -0,0 +1 @@ +5 --- mdp-2.6.orig/debian/README.Debian-source +++ mdp-2.6/debian/README.Debian-source @@ -0,0 +1,12 @@ +README on source packaging of mdp: +---------------------------------- + +Since 2.6, upstream tarballs are packaged directly from git +repository, no dh_wraporig is used any longer. + +Upstream git repository at sourceforge could be added to +debcheckout'ed Debian packaging with something like + +git remote add sf git://mdp-toolkit.git.sourceforge.net/gitroot/mdp-toolkit/mdp-toolkit +git fetch sf + --- mdp-2.6.orig/bimdp/hinet/biflownode.py +++ mdp-2.6/bimdp/hinet/biflownode.py @@ -3,8 +3,8 @@ import mdp.hinet as hinet n = mdp.numx -from ..binode import BiNode, BiNodeException -from ..biflow import BiFlow, BiFlowException +from bimdp import BiNode, BiNodeException +from bimdp import BiFlow, BiFlowException # TODO: add derived BiFlowNode which allow specification message flag for # BiFlowNode to specify the internal target? Or hardwired target? --- mdp-2.6.orig/bimdp/hinet/bilayer.py +++ mdp-2.6/bimdp/hinet/bilayer.py @@ -3,7 +3,7 @@ import mdp.hinet as hinet n = mdp.numx -from ..binode import BiNode, BiNodeException +from bimdp import BiNode, BiNodeException class CloneBiLayerException(BiNodeException): --- mdp-2.6.orig/bimdp/hinet/biswitchboard.py +++ mdp-2.6/bimdp/hinet/biswitchboard.py @@ -3,7 +3,7 @@ import mdp.hinet as hinet n = mdp.numx -from ..binode import BiNode +from bimdp import BiNode class BiSwitchboard(BiNode, hinet.Switchboard): --- mdp-2.6.orig/bimdp/parallel/parallelbiflow.py +++ mdp-2.6/bimdp/parallel/parallelbiflow.py @@ -12,8 +12,8 @@ import mdp.parallel as parallel -from ..biflow import (BiFlow, BiFlowException, MessageResultContainer, - BiCheckpointFlow) +from bimdp import (BiFlow, BiFlowException, MessageResultContainer, + BiCheckpointFlow) from parallelbihinet import BiFlowNode --- mdp-2.6.orig/bimdp/parallel/parallelbinode.py +++ mdp-2.6/bimdp/parallel/parallelbinode.py @@ -1,7 +1,7 @@ import mdp.parallel as parallel -from ..binode import BiNode +from bimdp import BiNode class ParallelExtensionBiNode(BiNode, parallel.ParallelExtensionNode): @@ -12,4 +12,4 @@ Unlike a normal ParallelNode a fork is always allowed, not only during training. """ - return self._fork() \ No newline at end of file + return self._fork() --- mdp-2.6.orig/bimdp/parallel/parallelbihinet.py +++ mdp-2.6/bimdp/parallel/parallelbihinet.py @@ -4,9 +4,9 @@ import mdp -from ..binode import BiNode, BiNodeException -from ..biflow import BiFlow -from ..hinet import BiFlowNode, CloneBiLayer +from bimdp import BiNode, BiNodeException +from bimdp import BiFlow +from bimdp.hinet import BiFlowNode, CloneBiLayer from parallelbinode import ParallelExtensionBiNode --- mdp-2.6.orig/bimdp/nodes/autogen_binodes.py +++ mdp-2.6/bimdp/nodes/autogen_binodes.py @@ -5,7 +5,7 @@ """ import mdp.nodes -from ..binode import BiNode +from bimdp import BiNode class AdaptiveCutoffBiNode(BiNode, mdp.nodes.AdaptiveCutoffNode): """Automatically created BiNode version of AdaptiveCutoffNode.""" --- mdp-2.6.orig/bimdp/nodes/miscnodes.py +++ mdp-2.6/bimdp/nodes/miscnodes.py @@ -1,6 +1,4 @@ -from __future__ import absolute_import - -from ..binode import BiNode, MSG_ID_SEP +from bimdp import BiNode, MSG_ID_SEP class IdentityBiNode(BiNode): --- mdp-2.6.orig/bimdp/nodes/autogen_biclassifiers.py +++ mdp-2.6/bimdp/nodes/autogen_biclassifiers.py @@ -5,7 +5,7 @@ """ import mdp.nodes -from ..biclassifier import BiClassifier +from bimdp import BiClassifier class SignumBiClassifier(BiClassifier, mdp.nodes.SignumClassifier): """Automatically created BiClassifier version of SignumClassifier.""" --- mdp-2.6.orig/bimdp/nodes/autogen.py +++ mdp-2.6/bimdp/nodes/autogen.py @@ -93,7 +93,7 @@ def _write_node_file(fid, node_classes, modulename="mdp.nodes", base_classname="BiNode", old_classname="Node", - base_import="from ..binode import BiNode"): + 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. @@ -133,7 +133,7 @@ for node_name in AUTOMATIC_MDP_CLASSIFIERS), base_classname="BiClassifier", old_classname="Classifier", - base_import="from ..biclassifier import BiClassifier") + base_import="from bimdp import BiClassifier") finally: autogen_file.close() print "wrote auto-generated code into file %s" % filename --- mdp-2.6.orig/bimdp/inspection/trace_inspection.py +++ mdp-2.6/bimdp/inspection/trace_inspection.py @@ -19,9 +19,9 @@ import mdp.hinet as hinet -from ..binode import BiNode -from ..biflow import BiFlow -from ..hinet import BiFlowNode, CloneBiLayer +from bimdp import BiNode +from bimdp import BiFlow +from bimdp.hinet import BiFlowNode, CloneBiLayer from bihinet_translator import BiHTMLTranslator from utils import robust_pickle --- mdp-2.6.orig/bimdp/inspection/bihinet_translator.py +++ mdp-2.6/bimdp/inspection/bihinet_translator.py @@ -7,9 +7,9 @@ import mdp -from ..binode import BiNode -from ..nodes import SenderBiNode -from ..hinet import CloneBiLayer +from bimdp import BiNode +from bimdp.nodes import SenderBiNode +from bimdp.hinet import CloneBiLayer # TODO: use
   
for whitespaces? --- mdp-2.6.orig/bimdp/inspection/facade.py +++ mdp-2.6/bimdp/inspection/facade.py @@ -13,7 +13,7 @@ from mdp import hinet from mdp import numx -from ..biflow import BiFlow +from bimdp import BiFlow from bihinet_translator import BIHINET_STYLE from trace_inspection import ( --- mdp-2.6.orig/mdp/__init__.py +++ mdp-2.6/mdp/__init__.py @@ -82,6 +82,7 @@ # try to load in sequence: scipy, numpy numx_description = None +numx_exceptions = {} for _label in _NUMX_LABELS: try: if _label == 'scipy': @@ -104,12 +105,20 @@ numx_version = numpy.version.version del numpy break - except ImportError: + except ImportError, exc: + # collect exceptions in case we don't find anything + # should help in debugging + numx_exceptions[_label] = exc pass if numx_description is None: - raise ImportError("Could not find any of the numeric modules " - "scipy or numpy") + msg = ("Could not import any of the numeric modules.\n" + "Import errors:\n"+'\n'.join([label+': '+str(exc) for label, exc in + numx_exceptions.items()])) + raise ImportError(msg) +else: + # we have numx, we don't need the exceptions anymore + del numx_exceptions del _os, _NUMX_LABELS, _USR_LABEL, _label @@ -157,13 +166,14 @@ __license__ = 'LGPL v3, http://www.gnu.org/licenses/lgpl.html' __contact__ = 'mdp-toolkit-users@lists.sourceforge.net' -# gather information about us -def info(): - import sys - # list of features - features = ('MDP Version', 'MDP Revision', 'Numerical Backend', +# list of features +__features__ = ('MDP Version', 'MDP Revision', 'Numerical Backend', 'Symeig Backend', 'Parallel Python Support', 'LibSVM', 'Shogun') + +# gather information about us +def _info(): + """Return dictionary containing info about MDP.""" # keep stuff in a dictionary # as soon as odict becomes a builtin, we can keep features and # info in the same ordered dictionary! @@ -193,10 +203,17 @@ else: SYMEIG = 'unknown' info['Symeig Backend'] = SYMEIG + return info - for feature in features: + +def info(): + """Return nicely formatted info about MDP.""" + import sys + info = _info() + for feature in __features__: sys.stderr.write(feature+': '+info[feature]+'\n') + # clean up namespace del signal_node del linear_flows --- mdp-2.6.orig/mdp/extension.py +++ mdp-2.6/mdp/extension.py @@ -21,7 +21,8 @@ (like the background pylint checks in the Eclipse IDE with PyDev). """ -from mdp import MDPException, NodeMetaclass +from mdp import MDPException, NodeMetaclass, utils +all = utils.all # TODO: note the ParllelBiFlowNode purge_nodes method, which is not part # of the ParallelNode interface. Allow this? --- mdp-2.6.orig/mdp/demo/demo_dictionary.py +++ mdp-2.6/mdp/demo/demo_dictionary.py @@ -55,7 +55,7 @@ -class DictionaryDemo(): +class DictionaryDemo(object): """This demo generates words from a selected dictionary by calculating the transition probabilities from two consecutive letters to the next. """ --- mdp-2.6.orig/mdp/demo/demo_bayes_guesser.py +++ mdp-2.6/mdp/demo/demo_bayes_guesser.py @@ -152,7 +152,7 @@ -class LanguageGuesserDemo(): +class LanguageGuesserDemo(object): def __init__(self, files): self.nbc = NaiveBayesClassifier(dtype="unicode") self.trainNaiveBayesClassifier(files) --- mdp-2.6.orig/mdp/test/test_process_schedule.py +++ mdp-2.6/mdp/test/test_process_schedule.py @@ -69,7 +69,21 @@ y1 = flow.execute(x) y2 = parallel_flow.execute(x) testing_tools.assert_array_almost_equal(abs(y1), abs(y2), precision) - + + def test_scheduler_mdp_version(self): + """Test that we are running the same mdp in subprocesses""" + scheduler = parallel.ProcessScheduler(verbose=False, + n_processes=2, + source_paths=None, + cache_callable=False) + for i in range(2): + scheduler.add_task(i, parallel.MDPVersionCallable()) + out = scheduler.get_results() + scheduler.shutdown() + # check that we get 2 identical dictionaries + self.assertTrue(out[0] == out[1], 'Subprocesses did not run' + + 'the same MDP as the parent:\n%s\n--\n%s'%(out[0], + out[1])) def get_suite(testname=None): # this suite just ignores the testname argument --- mdp-2.6.orig/mdp/parallel/process_schedule.py +++ mdp-2.6/mdp/parallel/process_schedule.py @@ -35,8 +35,8 @@ mdp_index = mdp_path.rfind("mdp") if mdp_index: mdp_path = mdp_path[:mdp_index-1] - # the mdp path takes precedence over PYTHONPATH - sys.path = [mdp_path] + sys.path + # mdp path goes after sys.path + sys.path = sys.path + [mdp_path] import mdp from scheduling import Scheduler, cpu_count --- mdp-2.6.orig/mdp/parallel/__init__.py +++ mdp-2.6/mdp/parallel/__init__.py @@ -20,7 +20,7 @@ from scheduling import ( ResultContainer, ListResultContainer, OrderedResultContainer, TaskCallable, SqrTestCallable, SleepSqrTestCallable, TaskCallableWrapper, Scheduler, - cpu_count + cpu_count, MDPVersionCallable ) from process_schedule import ProcessScheduler from thread_schedule import ThreadScheduler --- mdp-2.6.orig/mdp/parallel/scheduling.py +++ mdp-2.6/mdp/parallel/scheduling.py @@ -119,7 +119,14 @@ time.sleep(data[1]) return data[0]**2 +class MDPVersionCallable(TaskCallable): + """Callable For testing MDP version.""" + def __call__(self, data): + """Ignore input data and return mdp.info()""" + import mdp + return mdp._info() + class TaskCallableWrapper(TaskCallable): """Wrapper to provide a fork method for simple callables like a function. --- mdp-2.6.orig/mdp/utils/__init__.py +++ mdp-2.6/mdp/utils/__init__.py @@ -19,6 +19,17 @@ import mdp as _mdp import inspect as _inspect +# to support python2.4 +try: + all([]) + all = all +except NameError: + def all(iterable): + for element in iterable: + if not element: + return False + return True + try: # check if scipy.linalg.eigh is the new version # if yes, just wrap it @@ -89,7 +100,7 @@ __all__ = ['CovarianceMatrix', 'DelayCovarianceMatrix','CrossCovarianceMatrix', 'MultipleCovarianceMatrices', 'QuadraticForm', 'SymeigException', - 'comb', 'cov2', 'dig_node', 'get_dtypes', 'get_node_size', + 'all', 'comb', 'cov2', 'dig_node', 'get_dtypes', 'get_node_size', 'hermitian', 'inv', 'mult', 'mult_diag', 'nongeneral_svd', 'norm2', 'permute', 'pinv', 'progressinfo', 'random_rot', 'refcast', 'rotate', 'scast', 'solve', 'sqrtm',