Skip to content

Commit 80f9e38

Browse files
authored
Merge pull request #163 from arokem/requirements
Requirements
2 parents 1fab571 + ccfa4eb commit 80f9e38

File tree

7 files changed

+27
-17
lines changed

7 files changed

+27
-17
lines changed

doc/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
'sphinx.ext.doctest',
6060
'sphinx.ext.intersphinx',
6161
'sphinx.ext.todo',
62-
'sphinx.ext.pngmath',
6362
'numpydoc',
6463
'sphinx.ext.inheritance_diagram',
6564
'ipython_console_highlighting',

doc/examples/event_related_fmri.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
import os
2929

30-
from matplotlib.mlab import csv2rec
30+
import numpy as np
3131
import matplotlib.pyplot as plt
3232

3333
import nitime
@@ -40,14 +40,15 @@
4040

4141
"""
4242
43-
Next, we load the data into a recarray from the csv file, using csv2rec
43+
Next, we load the data into an array from the csv file, using ``np.loadtxt``
4444
4545
"""
4646

4747
data_path = os.path.join(nitime.__path__[0], 'data')
4848

49-
data = csv2rec(os.path.join(data_path, 'event_related_fmri.csv'))
49+
fname = os.path.join(data_path, 'event_related_fmri.csv')
5050

51+
data = np.genfromtxt(fname, dtype=float, delimiter=',', names=True)
5152

5253
"""
5354
@@ -56,15 +57,15 @@
5657
One TimeSeries is initialized for the BOLD data:
5758
"""
5859

59-
t1 = ts.TimeSeries(data.bold, sampling_interval=TR)
60+
t1 = ts.TimeSeries(data['bold'], sampling_interval=TR)
6061

6162
"""
6263
6364
And another one for the events (the different stimuli):
6465
6566
"""
6667

67-
t2 = ts.TimeSeries(data.events, sampling_interval=TR)
68+
t2 = ts.TimeSeries(data['events'], sampling_interval=TR)
6869

6970
"""
7071

doc/examples/filtering_fmri.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
import numpy as np
3030
import matplotlib.pyplot as plt
31-
from matplotlib.mlab import csv2rec
3231

3332

3433
"""
@@ -60,7 +59,8 @@
6059

6160
data_path = os.path.join(nitime.__path__[0], 'data')
6261

63-
data_rec = csv2rec(os.path.join(data_path, 'fmri_timeseries.csv'))
62+
data = np.loadtxt(os.path.join(data_path, 'fmri_timeseries.csv'),
63+
skiprows=1, delimiter=',')
6464

6565
# Extract ROI information from the csv file headers:
6666
roi_names = np.array(data_rec.dtype.names)

doc/examples/granger_fmri.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050

5151
import numpy as np
5252
import matplotlib.pyplot as plt
53-
from matplotlib.mlab import csv2rec
5453

5554
import nitime
5655
import nitime.analysis as nta
@@ -77,7 +76,9 @@
7776

7877
data_path = os.path.join(nitime.__path__[0], 'data')
7978

80-
data_rec = csv2rec(os.path.join(data_path, 'fmri_timeseries.csv'))
79+
fname = os.path.join(data_path, 'fmri_timeseries.csv')
80+
81+
data_rec = np.genfromtxt(fname, dtype=float, delimiter=',', names=True)
8182

8283
roi_names = np.array(data_rec.dtype.names)
8384
nseq = len(roi_names)

doc/examples/multi_taper_coh.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
import numpy as np
3030
import matplotlib.pyplot as plt
31-
from matplotlib.mlab import csv2rec
3231
import scipy.stats.distributions as dist
3332
from scipy import fftpack
3433

@@ -52,7 +51,9 @@
5251

5352
data_path = os.path.join(nitime.__path__[0], 'data')
5453

55-
data_rec = csv2rec(os.path.join(data_path, 'fmri_timeseries.csv'))
54+
fname = os.path.join(data_path, 'fmri_timeseries.csv')
55+
56+
data_rec = np.genfromtxt(fname, dtype=float, delimiter=',', names=True)
5657

5758

5859
"""

doc/examples/resting_state_fmri.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757

5858
data_rec = csv2rec(os.path.join(data_path, 'fmri_timeseries.csv'))
5959

60+
data_rec = np.genfromtxt(os.path.join(data_path, 'fmri_timeseries.csv'),
61+
names=True, delimiter=',')
62+
6063
"""
6164
6265
This data structure contains in its dtype a field 'names', which contains the
@@ -133,15 +136,15 @@
133136

134137
xc = C.xcorr_norm
135138

136-
idx_lcau = np.where(roi_names == 'lcau')[0]
137-
idx_rcau = np.where(roi_names == 'rcau')[0]
138-
idx_lput = np.where(roi_names == 'lput')[0]
139-
idx_rput = np.where(roi_names == 'rput')[0]
139+
idx_lcau = np.where(roi_names == 'LCau')[0]
140+
idx_rcau = np.where(roi_names == 'RCau')[0]
141+
idx_lput = np.where(roi_names == 'LPut')[0]
142+
idx_rput = np.where(roi_names == 'RPut')[0]
140143

141144
fig02 = plot_xcorr(xc,
142145
((idx_lcau, idx_rcau),
143146
(idx_lcau, idx_lput)),
144-
line_labels=['rcau', 'lput'])
147+
line_labels=['RCau', 'LPut'])
145148

146149
"""
147150

requirements-dev.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sphinx
2+
pytest
3+
pytest-cov
4+
nibabel
5+
networkx

0 commit comments

Comments
 (0)