Skip to content

Commit

Permalink
Merge commit 'alioth/yoh/master' into mh/master
Browse files Browse the repository at this point in the history
* commit 'alioth/yoh/master':
  NF(BF): MVPA_MATPLOTLIB_BACKEND config variable
  RF: addressed recent Michael's change + few PL issues
  RF+NF: HHS+IP -> HHS+09a, added also HHS+09b, references.txt got regenerated
  BF: proper header for bib2rst_ref tool, more information on exception while decoding unicode
  • Loading branch information
mih committed Jan 28, 2009
2 parents 762b11f + 6f93efb commit 5bd9b8d
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -242,8 +242,8 @@ unittests: unittest-nonlabile unittest unittest-badexternals \

te-%: build
@echo -n "I: Testing example $*: "
@MVPA_EXAMPLES_INTERACTIVE=no PYTHONPATH=. python doc/examples/$*.py \
>| temp-$@.log 2>&1 \
@MVPA_EXAMPLES_INTERACTIVE=no PYTHONPATH=. MVPA_MATPLOTLIB_BACKEND=agg \
python doc/examples/$*.py >| temp-$@.log 2>&1 \
&& echo "passed" || { echo "failed:"; cat temp-$@.log; }
@rm -f temp-$@.log

Expand Down
4 changes: 4 additions & 0 deletions doc/examples/pymvpa.cfg
Expand Up @@ -46,6 +46,10 @@ interactive = yes
# which SVM implementation to use by default: libsvm or shogun
backend = libsvm

[matplotlib]
# override the default matplotlib's backend
# backend = pdf

[externals]
# whether to really raise an exception when an externals test fails _and_
# raising an exception was requested
Expand Down
23 changes: 19 additions & 4 deletions doc/misc/references.bib
Expand Up @@ -253,12 +253,28 @@ @Manual{ HHS+latest
address = "Available online at http://www.pymvpa.org/PyMVPA-Manual.pdf"
}

@Article{ HHS+IP,
@Article{ HHS+09a,
title = "PyMVPA: A Python toolbox for multivariate pattern analysis of fMRI data",
author = "Michael Hanke and Yaroslav O Halchenko and Per B Sederberg and Stephen José Hanson and James V Haxby and Stefan Pollmann",
journal = "Neuroinformatics",
year = "in press",
pymvpa-summary = "Introduction into the analysis of fMRI data using PyMVPA."
year = "2009",
pymvpa-summary = "Introduction into the analysis of fMRI data using PyMVPA.",
volume = "In press",
doi = "10.1007/s12021-008-9041-y",
url = "http://dx.doi.org/10.1007/s12021-008-9041-y",
pymvpa-keywords = "PyMVPA, fMRI"
}

@Article{ HHS+09b,
author = "Michael Hanke and Yaroslav O. Halchenko and Per B. Sederberg and Emanuele Olivetti and Ingo Fründ and Jochem W. Rieger and Christoph S. Herrmann and James V. Haxby and Stephen José Hanson and Stefan Pollmann",
title = "{PyMVPA}: A Unifying Approach to the Analysis of Neuroscientific Data",
journal = "Frontiers in Neuroinformatics",
year = "2009",
pymvpa-summary = "Demonstration of PyMVPA capabilities concerning multi-modal or modality-agnostic data analysis.",
volume = "In press",
doi = "10.3389/neuro.11.003.2009",
url = "http://dx.doi.org/10.3389/neuro.11.003.2009",
pymvpa-keywords = "PyMVPA, fMRI, EEG, MEG, extracellular recordings"
}

@Article{ PMB+IP,
Expand All @@ -268,4 +284,3 @@ @Article{ PMB+IP
year = "in press",
doi = "10.1016/j.neuroimage.2008.11.007"
}

19 changes: 17 additions & 2 deletions doc/references.txt
Expand Up @@ -62,11 +62,26 @@ experiments.

**Hanke, M., Halchenko, Y. O., Sederberg, P. B. & Hughes, J. M.** The PyMVPA Manual. Available online at http://www.pymvpa.org/PyMVPA-Manual.pdf.

.. _HHS+IP:
.. _HHS+09a:

**Hanke, M., Halchenko, Y. O., Sederberg, P. B., Hanson, S. J., Haxby, J. V. & Pollmann, S.** (in press). PyMVPA: A Python toolbox for multivariate pattern analysis of fMRI data. *Neuroinformatics*.
**Hanke, M., Halchenko, Y. O., Sederberg, P. B., Hanson, S. J., Haxby, J. V. & Pollmann, S.** (2009). PyMVPA: A Python toolbox for multivariate pattern analysis of fMRI data. *Neuroinformatics*, *In press*.
*Introduction into the analysis of fMRI data using PyMVPA.*

Keywords: :keyword:`PyMVPA`, :keyword:`fMRI`

DOI: http://dx.doi.org/10.1007/s12021-008-9041-y


.. _HHS+09b:

**Hanke, M., Halchenko, Y. O., Sederberg, P. B., Olivetti, E., Fründ, I., Rieger, J. W., Herrmann, C. S., Haxby, J. V., Hanson, S. J. & Pollmann, S.** (2009). PyMVPA: A Unifying Approach to the Analysis of Neuroscientific Data. *Frontiers in Neuroinformatics*, *In press*.
*Demonstration of PyMVPA capabilities concerning multi-modal or
modality-agnostic data analysis.*

Keywords: :keyword:`PyMVPA`, :keyword:`fMRI`, :keyword:`EEG`, :keyword:`MEG`, :keyword:`extracellular recordings`

DOI: http://dx.doi.org/10.3389/neuro.11.003.2009


.. _HH08:

Expand Down
1 change: 1 addition & 0 deletions mvpa/base/externals.py
Expand Up @@ -191,6 +191,7 @@ def __check_pylab_plottable():
'pywt wp reconstruct fixed': "__check_pywt(['wp reconstruct fixed'])",
'rpy': "import rpy as __",
'lars': "import rpy; rpy.r.library('lars')",
'matplotlib': "import matplotlib as __",
'pylab': "import pylab as __",
'pylab plottable': "__check_pylab_plottable()",
'openopt': "import scikits.openopt as __",
Expand Down
5 changes: 2 additions & 3 deletions mvpa/misc/plot/erp.py
Expand Up @@ -38,7 +38,7 @@ def _offset(ax, x, y):
"""
d = dir(mlt)
if 'offset_copy' in d:
# XXX not tested but should work ;-)
# ??? not tested but should work ;-)
return mlt.offset_copy(ax.transData, x=x, y=y, units='dots')
elif 'BlendedAffine2D' in d:
# some newer versions of matplotlib
Expand Down Expand Up @@ -214,7 +214,6 @@ def plotERP(data, SR=500, onsets=None,
pre_mean = pre

# set default
# XXX should this be exposed?
pre_discard = 0

if onsets is not None: # if we need to extract ERPs
Expand All @@ -231,7 +230,6 @@ def plotERP(data, SR=500, onsets=None,
erp_data = bcm(data)

# override values since we are using Boxcar
pre_discard = 0
pre_onset = pre
else:
if pre_onset is None:
Expand Down Expand Up @@ -448,6 +446,7 @@ def plotERPs(erps, data=None, ax=None, pre=0.2, post=None,
zorder=1, offset=loffset)

def set_limits():
"""Helper to set x and y limits"""
ax.set_xlim( (-pre, post) )
if ylim != None:
ax.set_ylim(*ylim)
Expand Down
11 changes: 10 additions & 1 deletion mvpa/suite.py
Expand Up @@ -23,8 +23,17 @@


from mvpa import *
from mvpa.algorithms.cvtranserror import *
from mvpa.base import *

# Assure that we are setting up matplotlib's frontend prior to the
# first import of pylab.
if externals.exists("matplotlib"):
__backend = cfg.get('matplotlib', 'backend')
if __backend:
import matplotlib
matplotlib.use(__backend)

from mvpa.algorithms.cvtranserror import *
from mvpa.base.config import *
from mvpa.base.verbosity import *

Expand Down
16 changes: 13 additions & 3 deletions tools/bib2rst_ref.py
@@ -1,5 +1,12 @@
#!/usr/bin/env python

#emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
#ex: set sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
import _bibtex
import re

Expand Down Expand Up @@ -228,8 +235,11 @@ def open(self, filename):
# figure out what the last argument really does
# leaving in -1 seems to be save
value = _bibtex.expand(file, v, 0)[2]
value = unicode(value, 'utf-8')

try:
value = unicode(value, 'utf-8')
except UnicodeDecodeError, e:
print "ERROR: Failed to decode string '%s'" % value
raise
if k.lower() == 'author':
value = value.split(' and ')

Expand Down

0 comments on commit 5bd9b8d

Please sign in to comment.