- Timestamp:
- 12/16/11 15:06:47 (5 months ago)
- Location:
- trunk
- Files:
-
- 14 modified
-
doc/highlevelapi.txt (modified) (1 diff)
-
doc/highlevelapi_pcsim.txt (modified) (1 diff)
-
examples/SpikeSourcePoisson.py (modified) (1 diff)
-
examples/VAbenchmarks.py (modified) (1 diff)
-
examples/VAbenchmarks2-csa.py (modified) (1 diff)
-
examples/VAbenchmarks2.py (modified) (1 diff)
-
examples/VAbenchmarks3.py (modified) (1 diff)
-
examples/brunel.py (modified) (1 diff)
-
examples/small_network.py (modified) (1 diff)
-
src/common/populations.py (modified) (3 diffs)
-
src/neuroml.py (modified) (1 diff)
-
src/nineml/__init__.py (modified) (1 diff)
-
test/system/scenarios.py (modified) (3 diffs)
-
test/unsorted/generictests.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/highlevelapi.txt
r989 r1038 366 366 PyNN currently only provides one such measure, the mean number of spikes per neuron, e.g.:: 367 367 368 >>> p1.mean SpikeCount()368 >>> p1.mean_spike_count() 369 369 0.01 370 370 -
trunk/doc/highlevelapi_pcsim.txt
r756 r1038 303 303 PyNN currently only provides one such measure, the mean number of spikes per neuron, e.g.:: 304 304 305 >>> p1.mean SpikeCount()305 >>> p1.mean_spike_count() 306 306 0.0 307 307 -
trunk/examples/SpikeSourcePoisson.py
r647 r1038 21 21 run(300.0) 22 22 23 print "Mean spike count:", poissonsource.mean SpikeCount()23 print "Mean spike count:", poissonsource.mean_spike_count() 24 24 print "First few spikes:" 25 25 all_spikes = poissonsource.getSpikes() -
trunk/examples/VAbenchmarks.py
r915 r1038 167 167 simCPUTime = timer.diff() 168 168 169 E_count = exc_cells.mean SpikeCount()170 I_count = inh_cells.mean SpikeCount()169 E_count = exc_cells.mean_spike_count() 170 I_count = inh_cells.mean_spike_count() 171 171 172 172 # === Print results to file ==================================================== -
trunk/examples/VAbenchmarks2-csa.py
r1015 r1038 169 169 simCPUTime = timer.diff() 170 170 171 E_count = exc_cells.mean SpikeCount()172 I_count = inh_cells.mean SpikeCount()171 E_count = exc_cells.mean_spike_count() 172 I_count = inh_cells.mean_spike_count() 173 173 174 174 # === Print results to file ==================================================== -
trunk/examples/VAbenchmarks2.py
r915 r1038 167 167 simCPUTime = timer.diff() 168 168 169 E_count = exc_cells.mean SpikeCount()170 I_count = inh_cells.mean SpikeCount()169 E_count = exc_cells.mean_spike_count() 170 I_count = inh_cells.mean_spike_count() 171 171 172 172 # === Print results to file ==================================================== -
trunk/examples/VAbenchmarks3.py
r915 r1038 168 168 simCPUTime = timer.diff() 169 169 170 E_count = exc_cells.mean SpikeCount()171 I_count = inh_cells.mean SpikeCount()170 E_count = exc_cells.mean_spike_count() 171 I_count = inh_cells.mean_spike_count() 172 172 173 173 # === Print results to file ==================================================== -
trunk/examples/brunel.py
r869 r1038 199 199 I_net[[0, 1]].print_v(vinfilename) 200 200 201 E_rate = E_net.mean SpikeCount()*1000.0/simtime202 I_rate = I_net.mean SpikeCount()*1000.0/simtime201 E_rate = E_net.mean_spike_count()*1000.0/simtime 202 I_rate = I_net.mean_spike_count()*1000.0/simtime 203 203 204 204 # write a short report -
trunk/examples/small_network.py
r771 r1038 61 61 cells.print_v("Results/small_network_%s.v" % simulator_name) 62 62 63 print "Mean firing rate: ", cells.mean SpikeCount()*1000.0/simtime, "Hz"63 print "Mean firing rate: ", cells.mean_spike_count()*1000.0/simtime, "Hz" 64 64 65 65 # === Clean up and quit ======================================================== -
trunk/src/common/populations.py
r1036 r1038 547 547 return self.recorders['spikes'].count(gather, self.record_filter) 548 548 549 @deprecated("mean_spike_count()") 549 550 def meanSpikeCount(self, gather=True): 551 return self.mean_spike_count(gather) 552 553 def mean_spike_count(self, gather=True): 550 554 """ 551 555 Returns the mean number of spikes per neuron. 552 556 """ 553 spike_counts = self. recorders['spikes'].count(gather, self.record_filter)557 spike_counts = self.get_spike_counts(gather) 554 558 total_spikes = sum(spike_counts.values()) 555 559 if self._simulator.state.mpi_rank == 0 or not gather: # should maybe use allgather, and get the numbers on all nodes … … 647 651 return self.all_cells[self._mask_local] 648 652 649 @property650 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_cells655 656 653 def id_to_index(self, id): 657 654 """ … … 1229 1226 return self._get_recorded_variable('gsyn', gather, compatible_output, size=2) 1230 1227 1231 def mean SpikeCount(self, gather=True):1228 def mean_spike_count(self, gather=True): 1232 1229 """ 1233 1230 Returns the mean number of spikes per neuron. -
trunk/src/neuroml.py
r957 r1038 458 458 pass 459 459 460 def mean SpikeCount(self):460 def mean_spike_count(self): 461 461 return -1 462 462 -
trunk/src/nineml/__init__.py
r1010 r1038 166 166 pass 167 167 168 def mean SpikeCount(self, gather=True):168 def mean_spike_count(self, gather=True): 169 169 return 0 170 170 -
trunk/test/system/scenarios.py
r1000 r1038 76 76 sim.run(tstop) 77 77 78 E_count = cells['excitatory'].mean SpikeCount()79 I_count = cells['inhibitory'].mean SpikeCount()78 E_count = cells['excitatory'].mean_spike_count() 79 I_count = cells['inhibitory'].mean_spike_count() 80 80 print "Excitatory rate : %g Hz" % (E_count*1000.0/tstop,) 81 81 print "Inhibitory rate : %g Hz" % (I_count*1000.0/tstop,) … … 127 127 sim.run(tstop) 128 128 129 E_count = excitatory_cells.mean SpikeCount()130 I_count = inhibitory_cells.mean SpikeCount()129 E_count = excitatory_cells.mean_spike_count() 130 I_count = inhibitory_cells.mean_spike_count() 131 131 print "Excitatory rate : %g Hz" % (E_count*1000.0/tstop,) 132 132 print "Inhibitory rate : %g Hz" % (I_count*1000.0/tstop,) … … 258 258 sim.run(duration*second) 259 259 260 actual_rate = pre.mean SpikeCount()/duration260 actual_rate = pre.mean_spike_count()/duration 261 261 expected_rate = (r1+r2)/2 262 262 errmsg = "actual rate: %g expected rate: %g" % (actual_rate, expected_rate) 263 263 assert abs(actual_rate - expected_rate) < 1, errmsg 264 #assert abs(pre[:50].mean SpikeCount()/duration - r1) < 1265 #assert abs(pre[50:].mean SpikeCount()/duration- r2) < 1264 #assert abs(pre[:50].mean_spike_count()/duration - r1) < 1 265 #assert abs(pre[50:].mean_spike_count()/duration- r2) < 1 266 266 final_weights = connections.getWeights(format='array') 267 267 assert initial_weights[0,0] != final_weights[0,0] -
trunk/test/unsorted/generictests.py
r1036 r1038 529 529 class PopulationRecordTest(unittest.TestCase): 530 530 """Tests of the record(), record_v(), printSpikes(), print_v() and 531 mean SpikeCount() methods of the Population class."""531 mean_spike_count() methods of the Population class.""" 532 532 533 533 def setUp(self): … … 577 577 simtime = 1000.0 578 578 sim.run(simtime) 579 msc = self.pop1.mean SpikeCount()579 msc = self.pop1.mean_spike_count() 580 580 if sim.rank() == 0: # only on master node 581 581 rate = msc*1000/simtime 582 582 ##print self.pop1.recorders['spikes'].recorders 583 583 assert (20*0.8 < rate) and (rate < 20*1.2), "rate is %s" % rate 584 #rate = self.pop3.mean SpikeCount()*1000/simtime584 #rate = self.pop3.mean_spike_count()*1000/simtime 585 585 #self.assertEqual(rate, 0.0) 586 586
