Skip to content

Commit 2143a04

Browse files
author
Dilawar Singh
committed
Pulled changes from pgleeson@29e089a
1 parent fd77d8e commit 2143a04

File tree

1 file changed

+10
-65
lines changed

1 file changed

+10
-65
lines changed

python/moose/neuroml2/reader.py

Lines changed: 10 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,8 @@
11
# -*- coding: utf-8 -*-
2-
# reader.py ---
3-
#
4-
# Filename: reader.py
5-
# Description:
2+
63
# Author: Subhasis Ray, Padraig Gleeson
74
# Maintainer:
85
# Created: Wed Jul 24 15:55:54 2013 (+0530)
9-
# Version:
10-
# Last-Updated: 15 Jan 2018
11-
# By: pgleeson
12-
# Update #: --
13-
# URL:
14-
# Keywords:
15-
# Compatibility:
16-
#
17-
#
18-
19-
# Commentary:
20-
#
21-
#
22-
#
23-
#
24-
25-
# Change log:
26-
#
27-
#
28-
#
29-
#
30-
# This program is free software; you can redistribute it and/or
31-
# modify it under the terms of the GNU General Public License as
32-
# published by the Free Software Foundation; either version 3, or
33-
# (at your option) any later version.
34-
#
35-
# This program is distributed in the hope that it will be useful,
36-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
37-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
38-
# General Public License for more details.
39-
#
40-
# You should have received a copy of the GNU General Public License
41-
# along with this program; see the file COPYING. If not, write to
42-
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth
43-
# Floor, Boston, MA 02110-1301, USA.
44-
#
45-
#
466

477
# Code:
488
"""Implementation of reader for NeuroML 2 models.
@@ -51,13 +11,8 @@
5111
TODO: handle morphologies of more than one segment...
5212
5313
"""
14+
from __future__ import print_function, division, absolute_import
5415

55-
from __future__ import print_function
56-
try:
57-
from future_builtins import zip, map
58-
except ImportError:
59-
pass
60-
import sys, os
6116
import numpy as np
6217
from moose.neuroml2.hhfit import exponential2
6318
from moose.neuroml2.hhfit import sigmoid2
@@ -176,7 +131,7 @@ def __init__(self, verbose=False):
176131
self.nml_cells_to_moose = {} # NeuroML object to MOOSE object
177132
self.nml_segs_to_moose = {} # NeuroML object to MOOSE object
178133
self.nml_chans_to_moose = {} # NeuroML object to MOOSE object
179-
self.nml_conc_to_moose = {} # NeuroML object to MOOSE object
134+
self.nml_concs_to_moose = {} # NeuroML object to MOOSE object
180135
self.moose_to_nml = {} # Moose object to NeuroML object
181136
self.proto_cells = {} # map id to prototype cell in moose
182137
self.proto_chans = {} # map id to prototype channels in moose
@@ -656,26 +611,16 @@ def importConcentrationModels(self, doc):
656611

657612
def createDecayingPoolConcentrationModel(self, concModel):
658613
"""Create prototype for concentration model"""
659-
if concModel.name is not None:
614+
name = concModel.id
615+
if hasattr(concModel, 'name') and concModel.name is not None:
660616
name = concModel.name
661-
else:
662-
name = concModel.id
663-
ca = moose.CaConc('%s/%s' % (self.lib.path, id))
664-
print('11111', concModel.restingConc)
665-
print('2222', concModel.decayConstant)
666-
print('33333', concModel.shellThickness)
667-
668-
ca.CaBasal = SI(concModel.restingConc)
669-
ca.tau = SI(concModel.decayConstant)
670-
ca.thick = SI(concModel.shellThickness)
617+
ca = moose.CaConc('%s/%s' % (self.lib.path, name))
618+
619+
ca.CaBasal = SI(concModel.resting_conc)
620+
ca.tau = SI(concModel.decay_constant)
621+
ca.thick = SI(concModel.shell_thickness)
671622
ca.B = 5.2e-6 # B = 5.2e-6/(Ad) where A is the area of the shell and d is thickness - must divide by shell volume when copying
672623
self.proto_pools[concModel.id] = ca
673624
self.nml_concs_to_moose[concModel.id] = ca
674625
self.moose_to_nml[ca] = concModel
675626
logger.debug('Created moose element: %s for nml conc %s' % (ca.path, concModel.id))
676-
677-
678-
679-
680-
#
681-
# reader.py ends here

0 commit comments

Comments
 (0)