|
11 | 11 | }, |
12 | 12 | { |
13 | 13 | "cell_type": "code", |
14 | | - "execution_count": 3, |
| 14 | + "execution_count": 1, |
15 | 15 | "metadata": {}, |
16 | 16 | "outputs": [], |
17 | 17 | "source": [ |
|
27 | 27 | }, |
28 | 28 | { |
29 | 29 | "cell_type": "code", |
30 | | - "execution_count": 4, |
| 30 | + "execution_count": 3, |
31 | 31 | "metadata": {}, |
32 | | - "outputs": [ |
33 | | - { |
34 | | - "name": "stderr", |
35 | | - "output_type": "stream", |
36 | | - "text": [ |
37 | | - "/Users/caglar/anaconda/lib/python3.7/site-packages/xarray/core/formatting_html.py:6: UserWarning: Module neurolib was already imported from /Users/caglar/anaconda/lib/python3.7/site-packages/neurolib/__init__.py, but /Users/caglar/Documents/PhD/projects/neurolib is being added to sys.path\n", |
38 | | - " import pkg_resources\n" |
39 | | - ] |
40 | | - } |
41 | | - ], |
| 32 | + "outputs": [], |
42 | 33 | "source": [ |
43 | 34 | "try:\n", |
44 | 35 | " import matplotlib.pyplot as plt\n", |
|
54 | 45 | "from neurolib.models.aln import ALNModel\n", |
55 | 46 | "\n", |
56 | 47 | "# Some useful functions are provided here\n", |
57 | | - "import neurolib.utils.functions as func" |
| 48 | + "import neurolib.utils.functions as func\n", |
| 49 | + "from neurolib.utils.stimulus import construct_stimulus" |
58 | 50 | ] |
59 | 51 | }, |
60 | 52 | { |
|
79 | 71 | "cell_type": "markdown", |
80 | 72 | "metadata": {}, |
81 | 73 | "source": [ |
82 | | - "We can construct a simple stimulus using the function `func.construct_stimulus`:" |
| 74 | + "We can construct a simple stimulus using the function `stimulus.construct_stimulus`:" |
83 | 75 | ] |
84 | 76 | }, |
85 | 77 | { |
|
88 | 80 | "metadata": {}, |
89 | 81 | "outputs": [], |
90 | 82 | "source": [ |
91 | | - "stimulus = func.construct_stimulus(\"rect\", duration=model.params.duration, dt=model.params.dt, stim_amp=1.0, stim_freq=1)" |
| 83 | + "stimulus = construct_stimulus(\"rect\", duration=model.params.duration, dt=model.params.dt, stim_amp=1.0, stim_freq=1)" |
92 | 84 | ] |
93 | 85 | }, |
94 | 86 | { |
|
97 | 89 | "metadata": {}, |
98 | 90 | "outputs": [], |
99 | 91 | "source": [ |
100 | | - "stimulus = func.construct_stimulus(\"ac\", duration=model.params.duration, dt=model.params.dt, stim_amp=1.0, stim_freq=1)" |
| 92 | + "stimulus = construct_stimulus(\"ac\", duration=model.params.duration, dt=model.params.dt, stim_amp=1.0, stim_freq=1)" |
101 | 93 | ] |
102 | 94 | }, |
103 | 95 | { |
|
272 | 264 | "cell_type": "markdown", |
273 | 265 | "metadata": {}, |
274 | 266 | "source": [ |
275 | | - "`neurolib` helps you to create a few basic stimuli out of the box using the function `functions.construct_stimulus()`." |
| 267 | + "`neurolib` helps you to create a few basic stimuli out of the box using the function `stimulus.construct_stimulus()`." |
276 | 268 | ] |
277 | 269 | }, |
278 | 270 | { |
|
282 | 274 | "outputs": [], |
283 | 275 | "source": [ |
284 | 276 | "# construct a stimulus\n", |
285 | | - "ac_stimulus = func.construct_stimulus(stim=\"ac\", stim_freq = 25, duration=model.params.duration, dt=model.params.dt)\n", |
| 277 | + "ac_stimulus = construct_stimulus(stim=\"ac\", stim_freq = 25, duration=model.params.duration, dt=model.params.dt)\n", |
286 | 278 | "\n", |
287 | 279 | "# this stimulus is 1-dimensional. neurolib will threfore automatically apply it to *all nodes*.\n", |
288 | 280 | "model.params['ext_exc_current'] = ac_stimulus * 5.0 " |
|
335 | 327 | "outputs": [], |
336 | 328 | "source": [ |
337 | 329 | "# this stimulus is 1-dimensional\n", |
338 | | - "ac_stimulus = func.construct_stimulus(stim=\"ac\", stim_freq = 25, duration=model.params.duration, dt=model.params.dt)\n", |
| 330 | + "ac_stimulus = construct_stimulus(stim=\"ac\", stim_freq = 25, duration=model.params.duration, dt=model.params.dt)\n", |
339 | 331 | "\n", |
340 | 332 | "# let's make a N-dimensional stimulus vector out of it, by copying and pasting each entry N times\n", |
341 | 333 | "ac_stimulus = np.tile(ac_stimulus.T, (model.params.N, 1))\n", |
|
0 commit comments