def __init__(self, params, area): """ Default constructor. :param parameters: the model parameters for the :class:`IonicCurrent` :type parameters: dictionary :param area: the cell area :type area: string """ # Initialise attributes IonicCurrent.__init__(self, params, area) # self.tempK = "(" + params['temp'] + " + 273.15) * kelvin" self.tau = params['tau'] self.caInf = params['caInf'] self.kUnit = params['kUnit'] self.kFaraday = params['kFaraday'] self.depth = params['depth'] # Store safe string representation of parameters # self._tempK = utilities.getSafeStringParam(self.tempK) self._tau = utilities.getSafeStringParam(self.tau) self._caInf = utilities.getSafeStringParam(self.caInf) self._kUnit = utilities.getSafeStringParam(self.kUnit) self._kFaraday = utilities.getSafeStringParam(self.kFaraday) self._depth = utilities.getSafeStringParam(self.depth)
def __init__(self, parameters): """ Default constructor. :param area: the area of the soma of the neural cell :type area: float :param conductance: the conductance of the neural cell :type conductance: float """ # Initialise attributes self.parameters = parameters.values()[0] self.name = parameters.keys()[0] self.area = self.parameters['area'] self.conductance = self.parameters['conductance'] # Initialise list of defined currents - FG: fixes bug due to having an empty list of defined currents when including all the needed ones if 'defined' not in self.parameters[ 'currents']: # Keyword 'defined' doesn't exists self.parameters['currents']['defined'] = [] elif self.parameters['currents'][ 'defined'] is None: # List of 'defined' currents is undefined/empty self.parameters['currents']['defined'] = [] # Check for parameters specified as include files for f in self.parameters['currents'].get('included', []): try: with open(f) as curr: # Load included currents from file includes = yaml.load(curr) # Add them the list of defined currents self.parameters['currents'].get('defined', []).extend(includes) except IOError: raise IOError('Cannot load current parameter file named ' + f) # Remove list of includesd currents from dict of currents self.parameters['currents'].pop('included', []) # Initialise ionic current factory self.factory = icf.IonicCurrentFactory() # Build current list self.currents = [] for currentParams in self.parameters['currents'].get('defined', []): tmpCurrent = self.factory.makeIonicCurrent(currentParams, self.area) self.currents.append(tmpCurrent) # Store safe string representation of parameters self._area = utilities.getSafeStringParam(self.area) self._conductance = utilities.getSafeStringParam( utilities.getSafeStringParam(self.conductance) + ' * ' + self._area)
def __init__(self, params, area): """ Default constructor. :param parameters: the model parameters for the :class:`IonicCurrent` :type parameters: dictionary :param area: the cell area :type area: string """ # Initialise attributes IonicCurrent.__init__(self, params, area) self.beta = params['beta'] self.cac = params['cac'] self.tempAdj = "3.0 ** ((" + params['temp'] + " -22) / 10)" # Store safe string representation of parameters self._beta = utilities.getSafeStringParam(self.beta) self._cac = utilities.getSafeStringParam(self.cac) self._tempAdj = utilities.getSafeStringParam(self.tempAdj)
def __init__(self, params, area): """ Default constructor. :param parameters: the model parameters for the :class:`IonicCurrent` :type parameters: dictionary :param area: the cell area :type area: string """ # Initialise attributes IonicCurrent.__init__(self, params, area) self.tau = params['tau'] # Store safe string representation of parameters self._tau = utilities.getSafeStringParam(self.tau)