Skip to content

Commit 10947df

Browse files
committed
Merge pull request #5 from nipy/master
Update nipype fork.
2 parents 766b30a + d41b36a commit 10947df

File tree

24 files changed

+162
-110
lines changed

24 files changed

+162
-110
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ python:
44
- 2.7
55
# Setup anaconda
66
before_install:
7-
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then wget http://repo.continuum.io/miniconda/Miniconda-2.0.3-Linux-x86_64.sh -O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-2.0.3-Linux-x86_64.sh -O miniconda.sh; fi
7+
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then wget http://repo.continuum.io/miniconda/Miniconda-2.2.2-Linux-x86_64.sh -O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-2.2.2-Linux-x86_64.sh -O miniconda.sh; fi
88
- chmod +x miniconda.sh
99
- ./miniconda.sh -b
1010
- export PATH=/home/travis/anaconda/bin:$PATH
@@ -40,4 +40,4 @@ script:
4040

4141
# Calculate coverage
4242
after_success:
43-
- coveralls --config_file .coveragerc
43+
- coveralls --config_file .coveragerc

doc/_templates/indexsidebar.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h3>{{ _('Links') }}</h3>
66
<li>Code: <a href="http://github.com/nipy/nipype">Github</a> · <a href="http://github.com/nipy/nipype/issues">Bugs-Requests</a></li>
77
<li>Forum: <a href="http://groups.google.com/group/nipy-user">User</a> · <a href="http://projects.scipy.org/mailman/listinfo/nipy-devel">Developer</a></li>
88
<li>Info: <a href="http://nipy.org/software/license/index.html">License</a> · <a href="http://nipy.org/about/funding.html">Funding</a></li>
9-
<li><a href="https://travis-ci.org/nipy/nipy"><img src="https://travis-ci.org/nipy/nipype.png?branch=master" alt="travis"></a> · <a href='https://coveralls.io/r/nipy/nipype'><img src='https://coveralls.io/repos/nipy/nipype/badge.png' alt='Coverage Status' /></a></li>
9+
<li><a href="https://travis-ci.org/nipy/nipype"><img src="https://travis-ci.org/nipy/nipype.png?branch=master" alt="travis"></a> · <a href='https://coveralls.io/r/nipy/nipype'><img src='https://coveralls.io/repos/nipy/nipype/badge.png' alt='Coverage Status' /></a></li>
1010
</ul>
1111

12-
{% endblock %}
12+
{% endblock %}

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
Gorgolewski K, Burns CD, Madison C, Clark D, Halchenko YO, Waskom ML, Ghosh SS.
3636
(2011). Nipype: a flexible, lightweight and extensible neuroimaging data
37-
processing framework in Python. Front. Neuroimform. 5:13. `Download`__
37+
processing framework in Python. Front. Neuroinform. 5:13. `Download`__
3838

3939
__ paper_
4040

examples/fmri_openfmri.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,16 @@ def get_subs(subject_id, conds, model_id, task_id):
388388

389389
if __name__ == '__main__':
390390
import argparse
391+
defstr = ' (default %(default)s)'
391392
parser = argparse.ArgumentParser(prog='fmri_openfmri.py',
392393
description=__doc__)
393394
parser.add_argument('-d', '--datasetdir', required=True)
394-
parser.add_argument('-s', '--subject', default=None)
395-
parser.add_argument('-m', '--model', default=1)
396-
parser.add_argument('-t', '--task', default=1)
395+
parser.add_argument('-s', '--subject', default=None,
396+
help="Subject name (e.g. 'sub001')")
397+
parser.add_argument('-m', '--model', default=1,
398+
help="Model index" + defstr)
399+
parser.add_argument('-t', '--task', default=1,
400+
help="Task index" + defstr)
397401
parser.add_argument("-o", "--output_dir", dest="outdir",
398402
help="Output directory base")
399403
parser.add_argument("-w", "--work_dir", dest="work_dir",

examples/fmri_spm.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
1616
Import necessary modules from nipype."""
1717

18+
from nipype import config
19+
config.enable_provenance()
20+
1821
from nipype import spm, fsl
1922

2023
# In order to use this example with SPM's matlab common runtime
@@ -389,6 +392,4 @@ def getstripdir(subject_id):
389392

390393
if __name__ == '__main__':
391394
l1pipeline.run('MultiProc')
392-
# l2pipeline.run()
393-
# l1pipeline.write_graph()
394-
395+
l2pipeline.run('MultiProc')

nipype/external/provcopy.py

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import datetime
1515
import json
1616
import re
17+
import dateutil.parser
1718
import collections
1819
from collections import defaultdict
1920

@@ -179,31 +180,10 @@
179180

180181

181182
# Datatypes
182-
_r_xsd_dateTime = re.compile(""" ^
183-
(?P<year>-?[0-9]{4}) - (?P<month>[0-9]{2}) - (?P<day>[0-9]{2})
184-
T (?P<hour>[0-9]{2}) : (?P<minute>[0-9]{2}) : (?P<second>[0-9]{2})
185-
(?P<microsecond>\.[0-9]{1,6})?
186-
(?P<tz>
187-
Z | (?P<tz_hr>[-+][0-9]{2}) : (?P<tz_min>[0-9]{2})
188-
)?
189-
$ """, re.X)
190-
191183
attr2rdf = lambda attr: PROV[PROV_ID_ATTRIBUTES_MAP[attr].split('prov:')[1]].rdf_representation()
192184

193185
def _parse_xsd_dateTime(s):
194-
"""Returns datetime or None."""
195-
m = _r_xsd_dateTime.match(s)
196-
if m is not None:
197-
values = m.groupdict()
198-
if values["microsecond"] is None:
199-
values["microsecond"] = 0
200-
else:
201-
values["microsecond"] = values["microsecond"][1:]
202-
values["microsecond"] += "0" * (6 - len(values["microsecond"]))
203-
values = dict((k, int(v)) for k, v in values.iteritems() if not k.startswith("tz"))
204-
return datetime.datetime(**values)
205-
else:
206-
return None
186+
return dateutil.parser.parse(s)
207187

208188

209189
def _ensure_datetime(time):
@@ -359,7 +339,7 @@ def provn_representation(self):
359339

360340
def json_representation(self):
361341
return {'$': self._uri, 'type': u'xsd:anyURI'}
362-
342+
363343
def rdf_representation(self):
364344
return URIRef(self.get_uri())
365345

@@ -773,7 +753,7 @@ def rdf(self, graph=None, subj=None):
773753
obj = RDFLiteral(value)
774754
graph.add((subj, pred, obj))
775755
return graph
776-
756+
777757
def is_asserted(self):
778758
return self._asserted
779759

@@ -788,7 +768,7 @@ def is_relation(self):
788768
class ProvElement(ProvRecord):
789769
def is_element(self):
790770
return True
791-
771+
792772
def rdf(self, graph=None):
793773
if graph is None:
794774
graph = Graph()
@@ -1666,15 +1646,15 @@ def rdf(self, graph=None):
16661646
# graph should not None here
16671647
uri = self.get_identifier().rdf_representation()
16681648
graph = Graph(graph.store, uri)
1669-
1649+
16701650
for prefix, namespace in self._namespaces.items():
16711651
graph.bind(prefix, namespace.get_uri())
1672-
1652+
16731653
for record in self._records:
16741654
if record.is_asserted():
16751655
record.rdf(graph)
16761656
return graph
1677-
1657+
16781658
def get_provjson(self, **kw):
16791659
"""Return the `PROV-JSON <http://www.w3.org/Submission/prov-json/>`_ representation for the bundle/document.
16801660

nipype/interfaces/afni/tests/test_auto_Volreg.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,27 @@ def test_Volreg_inputs():
2020
args=dict(argstr='%s',
2121
),
2222
outputtype=dict(),
23-
md1dfile=dict(position=-4,
24-
argstr='-maxdisp1D %s',
25-
),
2623
zpad=dict(position=-5,
2724
argstr='-zpad %d',
2825
),
2926
terminal_output=dict(mandatory=True,
3027
nohash=True,
3128
),
32-
environ=dict(nohash=True,
33-
usedefault=True,
29+
md1d_file=dict(name_source='in_file',
30+
keep_extension=True,
31+
position=-4,
32+
name_template='%s_md.1D',
33+
argstr='-maxdisp1D %s',
3434
),
3535
in_file=dict(position=-1,
3636
mandatory=True,
3737
argstr='%s',
3838
),
3939
copyorigin=dict(argstr='-twodup',
4040
),
41+
environ=dict(nohash=True,
42+
usedefault=True,
43+
),
4144
out_file=dict(name_source='in_file',
4245
name_template='%s_volreg',
4346
argstr='-prefix %s',

nipype/interfaces/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,8 @@ def run_command(runtime, output=None, timeout=0.01):
11161116
cwd=runtime.cwd,
11171117
env=runtime.environ)
11181118
result = {}
1119+
errfile = os.path.join(runtime.cwd, 'stderr.nipype')
1120+
outfile = os.path.join(runtime.cwd, 'stdout.nipype')
11191121
if output == 'stream':
11201122
streams = [Stream('stdout', proc.stdout), Stream('stderr', proc.stderr)]
11211123

@@ -1152,8 +1154,6 @@ def _process(drain=0):
11521154
result['stderr'] = stderr.split('\n')
11531155
result['merged'] = ''
11541156
if output == 'file':
1155-
errfile = os.path.join(runtime.cwd, 'stderr.nipype')
1156-
outfile = os.path.join(runtime.cwd, 'stdout.nipype')
11571157
stderr = open(errfile, 'wt')
11581158
stdout = open(outfile, 'wt')
11591159
proc = subprocess.Popen(runtime.cmdline,

nipype/interfaces/cmtk/convert.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
package_check('cfflib')
2424
except Exception, e:
2525
have_cfflib = False
26-
warnings.warn('cfflib not installed')
2726
else:
2827
import cfflib as cf
2928

nipype/interfaces/cmtk/nbs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package_check('cviewer')
1818
except Exception, e:
1919
have_cv = False
20-
warnings.warn('ConnectomeViewer not installed')
2120
else:
2221
import cviewer.libs.pyconto.groupstatistics.nbs as nbs
2322

0 commit comments

Comments
 (0)