Changeset 1038 for trunk

Show
Ignore:
Timestamp:
12/16/11 15:06:47 (5 months ago)
Author:
apdavison
Message:

Removed Population.cell property (replaced by all_cells, and deprecated since 0.6)

Location:
trunk
Files:
14 modified

Legend:

Unmodified
Added
Removed
  • trunk/doc/highlevelapi.txt

    r989 r1038  
    366366PyNN currently only provides one such measure, the mean number of spikes per neuron, e.g.:: 
    367367 
    368     >>> p1.meanSpikeCount() 
     368    >>> p1.mean_spike_count() 
    369369    0.01 
    370370     
  • trunk/doc/highlevelapi_pcsim.txt

    r756 r1038  
    303303PyNN currently only provides one such measure, the mean number of spikes per neuron, e.g.:: 
    304304 
    305     >>> p1.meanSpikeCount() 
     305    >>> p1.mean_spike_count() 
    306306    0.0 
    307307     
  • trunk/examples/SpikeSourcePoisson.py

    r647 r1038  
    2121run(300.0) 
    2222   
    23 print "Mean spike count:", poissonsource.meanSpikeCount() 
     23print "Mean spike count:", poissonsource.mean_spike_count() 
    2424print "First few spikes:" 
    2525all_spikes = poissonsource.getSpikes() 
  • trunk/examples/VAbenchmarks.py

    r915 r1038  
    167167simCPUTime = timer.diff() 
    168168 
    169 E_count = exc_cells.meanSpikeCount() 
    170 I_count = inh_cells.meanSpikeCount() 
     169E_count = exc_cells.mean_spike_count() 
     170I_count = inh_cells.mean_spike_count() 
    171171 
    172172# === Print results to file ==================================================== 
  • trunk/examples/VAbenchmarks2-csa.py

    r1015 r1038  
    169169simCPUTime = timer.diff() 
    170170 
    171 E_count = exc_cells.meanSpikeCount() 
    172 I_count = inh_cells.meanSpikeCount() 
     171E_count = exc_cells.mean_spike_count() 
     172I_count = inh_cells.mean_spike_count() 
    173173 
    174174# === Print results to file ==================================================== 
  • trunk/examples/VAbenchmarks2.py

    r915 r1038  
    167167simCPUTime = timer.diff() 
    168168 
    169 E_count = exc_cells.meanSpikeCount() 
    170 I_count = inh_cells.meanSpikeCount() 
     169E_count = exc_cells.mean_spike_count() 
     170I_count = inh_cells.mean_spike_count() 
    171171 
    172172# === Print results to file ==================================================== 
  • trunk/examples/VAbenchmarks3.py

    r915 r1038  
    168168simCPUTime = timer.diff() 
    169169 
    170 E_count = exc_cells.meanSpikeCount() 
    171 I_count = inh_cells.meanSpikeCount() 
     170E_count = exc_cells.mean_spike_count() 
     171I_count = inh_cells.mean_spike_count() 
    172172 
    173173# === Print results to file ==================================================== 
  • trunk/examples/brunel.py

    r869 r1038  
    199199I_net[[0, 1]].print_v(vinfilename) 
    200200 
    201 E_rate = E_net.meanSpikeCount()*1000.0/simtime 
    202 I_rate = I_net.meanSpikeCount()*1000.0/simtime 
     201E_rate = E_net.mean_spike_count()*1000.0/simtime 
     202I_rate = I_net.mean_spike_count()*1000.0/simtime 
    203203 
    204204# write a short report 
  • trunk/examples/small_network.py

    r771 r1038  
    6161cells.print_v("Results/small_network_%s.v" % simulator_name) 
    6262 
    63 print "Mean firing rate: ", cells.meanSpikeCount()*1000.0/simtime, "Hz" 
     63print "Mean firing rate: ", cells.mean_spike_count()*1000.0/simtime, "Hz" 
    6464 
    6565# === Clean up and quit ======================================================== 
  • trunk/src/common/populations.py

    r1036 r1038  
    547547        return self.recorders['spikes'].count(gather, self.record_filter) 
    548548 
     549    @deprecated("mean_spike_count()") 
    549550    def meanSpikeCount(self, gather=True): 
     551        return self.mean_spike_count(gather) 
     552 
     553    def mean_spike_count(self, gather=True): 
    550554        """ 
    551555        Returns the mean number of spikes per neuron. 
    552556        """ 
    553         spike_counts = self.recorders['spikes'].count(gather, self.record_filter) 
     557        spike_counts = self.get_spike_counts(gather) 
    554558        total_spikes = sum(spike_counts.values()) 
    555559        if self._simulator.state.mpi_rank == 0 or not gather:  # should maybe use allgather, and get the numbers on all nodes 
     
    647651        return self.all_cells[self._mask_local] 
    648652 
    649     @property 
    650     def cell(self): 
    651         warn("The `Population.cell` attribute is not an official part of the \ 
    652               API, and its use is deprecated. It will be removed in a future \ 
    653               release. All uses of `cell` may be replaced by `all_cells`") 
    654         return self.all_cells 
    655  
    656653    def id_to_index(self, id): 
    657654        """ 
     
    12291226        return self._get_recorded_variable('gsyn', gather, compatible_output, size=2) 
    12301227 
    1231     def meanSpikeCount(self, gather=True): 
     1228    def mean_spike_count(self, gather=True): 
    12321229        """ 
    12331230        Returns the mean number of spikes per neuron. 
  • trunk/src/neuroml.py

    r957 r1038  
    458458        pass 
    459459     
    460     def meanSpikeCount(self): 
     460    def mean_spike_count(self): 
    461461        return -1 
    462462     
  • trunk/src/nineml/__init__.py

    r1010 r1038  
    166166        pass 
    167167 
    168     def meanSpikeCount(self, gather=True): 
     168    def mean_spike_count(self, gather=True): 
    169169        return 0 
    170170 
  • trunk/test/system/scenarios.py

    r1000 r1038  
    7676    sim.run(tstop) 
    7777     
    78     E_count = cells['excitatory'].meanSpikeCount() 
    79     I_count = cells['inhibitory'].meanSpikeCount() 
     78    E_count = cells['excitatory'].mean_spike_count() 
     79    I_count = cells['inhibitory'].mean_spike_count() 
    8080    print "Excitatory rate        : %g Hz" % (E_count*1000.0/tstop,) 
    8181    print "Inhibitory rate        : %g Hz" % (I_count*1000.0/tstop,) 
     
    127127    sim.run(tstop) 
    128128     
    129     E_count = excitatory_cells.meanSpikeCount() 
    130     I_count = inhibitory_cells.meanSpikeCount() 
     129    E_count = excitatory_cells.mean_spike_count() 
     130    I_count = inhibitory_cells.mean_spike_count() 
    131131    print "Excitatory rate        : %g Hz" % (E_count*1000.0/tstop,) 
    132132    print "Inhibitory rate        : %g Hz" % (I_count*1000.0/tstop,) 
     
    258258    sim.run(duration*second) 
    259259     
    260     actual_rate = pre.meanSpikeCount()/duration 
     260    actual_rate = pre.mean_spike_count()/duration 
    261261    expected_rate = (r1+r2)/2 
    262262    errmsg = "actual rate: %g  expected rate: %g" % (actual_rate, expected_rate) 
    263263    assert abs(actual_rate - expected_rate) < 1, errmsg 
    264     #assert abs(pre[:50].meanSpikeCount()/duration - r1) < 1 
    265     #assert abs(pre[50:].meanSpikeCount()/duration- r2) < 1 
     264    #assert abs(pre[:50].mean_spike_count()/duration - r1) < 1 
     265    #assert abs(pre[50:].mean_spike_count()/duration- r2) < 1 
    266266    final_weights = connections.getWeights(format='array') 
    267267    assert initial_weights[0,0] != final_weights[0,0] 
  • trunk/test/unsorted/generictests.py

    r1036 r1038  
    529529class PopulationRecordTest(unittest.TestCase): 
    530530    """Tests of the record(), record_v(), printSpikes(), print_v() and 
    531        meanSpikeCount() methods of the Population class.""" 
     531       mean_spike_count() methods of the Population class.""" 
    532532     
    533533    def setUp(self): 
     
    577577        simtime = 1000.0 
    578578        sim.run(simtime) 
    579         msc = self.pop1.meanSpikeCount() 
     579        msc = self.pop1.mean_spike_count() 
    580580        if sim.rank() == 0: # only on master node 
    581581            rate = msc*1000/simtime 
    582582            ##print self.pop1.recorders['spikes'].recorders 
    583583            assert (20*0.8 < rate) and (rate < 20*1.2), "rate is %s" % rate 
    584         #rate = self.pop3.meanSpikeCount()*1000/simtime 
     584        #rate = self.pop3.mean_spike_count()*1000/simtime 
    585585        #self.assertEqual(rate, 0.0) 
    586586