Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63385330
__init__.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 19, 18:24
Size
1 KB
Mime Type
text/x-python
Expires
Tue, May 21, 18:24 (2 d)
Engine
blob
Format
Raw Data
Handle
17767114
Attached To
R4670 PySONIC (old)
__init__.py
View Options
# -*- coding: utf-8 -*-
# @Author: Theo Lemaire
# @Email: theo.lemaire@epfl.ch
# @Date: 2017-06-06 13:36:00
# @Last Modified by: Theo Lemaire
# @Last Modified time: 2019-11-13 10:51:10
import
inspect
import
sys
from
.simulators
import
*
from
.batches
import
*
from
.model
import
*
from
.pneuron
import
*
from
.bls
import
*
from
.translators
import
*
from
.nbls
import
*
from
.vclamp
import
*
from
.lookups
import
*
from
.protocols
import
*
from
..neurons
import
getPointNeuron
def
getModelsDict
():
''' Construct a dictionary of all model classes, indexed by simulation key. '''
current_module
=
sys
.
modules
[
__name__
]
models_dict
=
{}
for
_
,
obj
in
inspect
.
getmembers
(
current_module
):
if
inspect
.
isclass
(
obj
)
and
hasattr
(
obj
,
'simkey'
)
and
isinstance
(
obj
.
simkey
,
str
):
models_dict
[
obj
.
simkey
]
=
obj
return
models_dict
def
getModel
(
meta
):
''' Return appropriate model object based on a dictionary of meta-information. '''
if
meta
[
'simkey'
]
==
'MECH'
:
model
=
BilayerSonophore
(
meta
[
'a'
],
meta
[
'Cm0'
],
meta
[
'Qm0'
])
else
:
model
=
getPointNeuron
(
meta
[
'neuron'
])
if
meta
[
'simkey'
]
==
'ASTIM'
:
model
=
NeuronalBilayerSonophore
(
meta
[
'a'
],
model
,
meta
[
'Fdrive'
])
elif
meta
[
'simkey'
]
==
'VCLAMP'
:
model
=
VoltageClamp
(
model
)
return
model
Event Timeline
Log In to Comment