Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit 0561457

Browse files
authored
Merge pull request #368 from alberto-antonietti/fix_tm_example
Fix Tsodyks Markram example
2 parents f0b2d8b + c0da239 commit 0561457

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

examples/tsodyksmarkramstp/tmevaluator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def __init__(self, t, v, tstim, params):
6565
for name, minval, maxval in self.params]
6666
# Objectives
6767
self.objectives = [bpop.objectives.Objective('interval_%d' % (i,))
68-
for i in xrange(len(self.split_idx))]
68+
for i in xrange(len(list(self.split_idx)))]
6969

7070
def generate_model(self, individual):
7171
"""Calls numerical integrator `tmodeint.py` and returns voltage trace based on the input parameters"""

examples/tsodyksmarkramstp/tsodyksmarkramstp.ipynb

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,10 @@
828828
"sns.set_style('whitegrid')\n",
829829
"\n",
830830
"# Load and display in vitro trace\n",
831-
"trace = pickle.load(open('trace.pkl'))\n",
831+
"with open('trace.pkl', 'rb') as f:\n",
832+
" u = pickle._Unpickler(f)\n",
833+
" u.encoding = 'latin1'\n",
834+
" trace = u.load()\n",
832835
"fig, ax = plt.subplots()\n",
833836
"ax.plot(trace['t'], trace['v'], label='in vitro')\n",
834837
"ax.legend(loc=0)\n",
@@ -1702,17 +1705,20 @@
17021705
"cell_type": "code",
17031706
"execution_count": null,
17041707
"metadata": {
1705-
"collapsed": true
1708+
"collapsed": true,
1709+
"jupyter": {
1710+
"outputs_hidden": true
1711+
}
17061712
},
17071713
"outputs": [],
17081714
"source": []
17091715
}
17101716
],
17111717
"metadata": {
17121718
"kernelspec": {
1713-
"display_name": "Python 3",
1719+
"display_name": "unstable",
17141720
"language": "python",
1715-
"name": "python3"
1721+
"name": "unstable"
17161722
},
17171723
"language_info": {
17181724
"codemirror_mode": {
@@ -1724,9 +1730,9 @@
17241730
"name": "python",
17251731
"nbconvert_exporter": "python",
17261732
"pygments_lexer": "ipython3",
1727-
"version": "3.7.0"
1733+
"version": "3.8.3"
17281734
}
17291735
},
17301736
"nbformat": 4,
1731-
"nbformat_minor": 2
1737+
"nbformat_minor": 4
17321738
}

0 commit comments

Comments
 (0)