Changeset 426

Show
Ignore:
Timestamp:
07/22/08 16:28:09 (1 month ago)
Author:
apdavison
Message:

Fixed a problem in nest2.Recorder.record() after using dynamic synapses.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/nest2/__init__.py

    r425 r426  
    133133         
    134134        device_name = nest.GetStatus(self._device, "model")[0] 
     135        original_synapse_context = nest.GetSynapseContext() 
     136        if original_synapse_context != 'static_synapse': 
     137            nest.SetSynapseContext('static_synapse') 
    135138        if device_name == "spike_detector": 
    136139            nest.ConvergentConnect(new_ids, self._device) 
     
    139142        else: 
    140143            raise Exception("%s is not a valid recording device" % device_name) 
     144        if original_synapse_context != 'static_synapse': 
     145            nest.SetSynapseContext(original_synapse_context) 
    141146     
    142147    def get(self, gather=False): 
     
    590595            self.cell = numpy.reshape(self.cell, self.dim) 
    591596            if self.cellparams: 
    592                 nest.SetStatus(self.cell_local, [self.cellparams]) 
     597                try: 
     598                    nest.SetStatus(self.cell_local, [self.cellparams]) 
     599                except nest.hl_api.NESTError: 
     600                    print "NEST error when trying to set the following dictionary: %s" % self.cellparams 
     601                    raise 
    593602            self._local_ids = self.cell_local 
    594603