Skip to content

Commit 6fce93b

Browse files
author
Dilawar Singh
committed
Able to run nml2 example with python3 (BhallaLab/moose#253).
1 parent f25469a commit 6fce93b

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

python/moose/neuroml2/reader.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,21 @@
44
# Description: NeuroML2 reader.
55
# Implementation of reader for NeuroML 2 models.
66
# TODO: handle morphologies of more than one segment...
7+
#
78
# Author: Subhasis Ray, Padraig Gleeson
8-
# Maintainer: Dilawar Singh <dilawars@ncbs.res.in>
9+
# Maintainer: Dilawar Singh <dilawars@ncbs.res.in>
910
# Created: Wed Jul 24 15:55:54 2013 (+0530)
11+
#
1012
# Notes:
1113
# For update/log, please see git-blame documentation or browse the github
1214
# repo https://github.com/BhallaLab/moose-core
1315

14-
15-
try:
16-
from future_builtins import zip, map
17-
except ImportError as e:
18-
pass
19-
2016
import os
2117
import math
2218
import numpy as np
2319
import moose
24-
import logging
2520

21+
import logging
2622
logger_ = logging.getLogger('moose.nml2')
2723

2824
import neuroml as nml
@@ -549,7 +545,10 @@ def copyChannel(self, chdens, comp, condDensity, erev):
549545
orig = chdens.id
550546
chid = moose.copy(proto_chan, comp, chdens.id)
551547
chan = moose.element(chid)
552-
for p in self.paths_to_chan_elements.keys():
548+
549+
# We are updaing the keys() here. Need copy: using list(keys()) to
550+
# create a copy.
551+
for p in list(self.paths_to_chan_elements.keys()):
553552
pp = p.replace('%s/'%chdens.ion_channel,'%s/'%orig)
554553
self.paths_to_chan_elements[pp] = self.paths_to_chan_elements[p].replace('%s/'%chdens.ion_channel,'%s/'%orig)
555554
#logger_.info(self.paths_to_chan_elements)

0 commit comments

Comments
 (0)