Changeset 311
- Timestamp:
- 11/10/08 11:21:06 (2 months ago)
- Files:
-
- trunk/src/analysis.py (modified) (1 diff)
- trunk/src/parameters.py (modified) (2 diffs)
- trunk/src/random.py (modified) (1 diff)
- trunk/src/signals.py (modified) (3 diffs)
- trunk/src/visual_logging.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/analysis.py
r298 r311 10 10 from NeuroTools import check_dependency 11 11 12 13 def arrays_almost_equal(a, b, threshold): 14 return (abs(a-b) < threshold).all() 12 15 13 16 def ccf(x, y, axis=None): trunk/src/parameters.py
r298 r311 1 1 """ 2 Module for dealing with model parameters. 3 4 Andrew Davison, UNIC, CNRS 5 Eilif Muller, EPFL, Switzerland 6 $Id:$ 2 NeuroTools.parameters 3 ===================== 4 5 A module for dealing with model parameters. 6 7 Classes 8 ------- 9 10 Parameter 11 ParameterRange - for specifying a list of possible values for a given parameter. 12 ParameterSet - for representing/managing hierarchical parameter sets. 13 ParameterTable - a sub-class of ParameterSet that can represent a table of parameters. 14 ParameterSpace - a collection of ParameterSets, representing multiple points in 15 parameter space. 16 17 Functions 18 --------- 19 20 nesteddictwalk - Walk a nested dict structure, using a generator. 21 nesteddictflatten - Return a flattened version of a nested dict structure. 22 string_table - Convert a table written as a multi-line string into a dict of dicts. 23 7 24 """ 8 25 … … 75 92 class ParameterRange(Parameter): 76 93 """ 77 A class for specifying a list of possible parameters for a given 78 parameter. 94 A class for specifying a list of possible values for a given parameter. 79 95 80 96 The value must be an iterable. It acts like a Parameter, but .next() can be trunk/src/random.py
r298 r311 1 # Classes for specifiying a parameter by a statistical distribution 1 """ 2 NeuroTools.random 3 ===================== 4 5 A set of classes representing statistical distributions, with an interface that 6 is compatible with the ParameterSpace class in the parameters module. 7 8 Classes 9 ------- 10 11 GammaDist - gamma.pdf(x,a,b) = x**(a-1)*exp(-x/b)/gamma(a)/b**a 12 NormalDist - normal distribution 13 UniformDist - uniform distribution 14 15 """ 2 16 3 17 from NeuroTools import check_dependency trunk/src/signals.py
r308 r311 9 9 ------- 10 10 11 SpikeTrain - An object representing a spike train, for one cells. Useful for plots, 12 calculus like ISI, CV, mean rate(), ... 13 SpikeList - An object representing the activity of a population of neurons. It's a 14 dictionnary of SpikeTrain objects, and again, the SpikeList object have 15 built-in methods to compute firing_rate, ISI, CV, cross-correlations, and 16 so on. 11 SpikeTrain - An object representing a spike train, for one cell. Useful for plots, 12 calculations such as ISI, CV, mean rate(), ... 13 SpikeList - An object representing the activity of a population of neurons. Functions as a 14 dictionary of SpikeTrain objects, with methods to compute firing rate, 15 ISI, CV, cross-correlations, and so on. 17 16 AnalogSignal - An object representing an analog signal, with its data. Can be used to do 18 17 threshold detection, event triggered averages, ... 19 AnalogSignalList - A list of AnalogSignal objects, again with functions such as mean, std, plot,18 AnalogSignalList - A list of AnalogSignal objects, again with methods such as mean, std, plot, 20 19 and so on 21 20 VmList - An AnalogSignalList object used for Vm traces 22 ConductanceList - An AnalogSignalList object used for conductance straces21 ConductanceList - An AnalogSignalList object used for conductance traces 23 22 CurrentList - An AnalogSignalList object used for current traces 24 23 … … 26 25 --------- 27 26 28 load_spikelist - Function to load a SpikeList object from a file that have been generated by pyNN.29 Can also have been generated by your particular simulator/format, but then you have27 load_spikelist - load a SpikeList object from a file. Expects a particular format. 28 Can also load data in a different format, but then you have 30 29 to write your own File object that will know how to read the data (see io.py) 31 load_vmlist - Function to load a VmList object (inherits from AnalogSignalList) from a file 32 generated by pyNN. Same comments that previously. Note also that as load_conductancelist 33 the function returns two CurrentList, one for the exc current and one for the inh current 34 load_currentlist - Function to load a CurrentList object (inherits from AnalogSignalList) from a file 35 generated by pyNN. Same comments that previously. Note also that as load_conductancelist 36 the function returns two CurrentList, one for the exc current and one for the inh current 37 load_conductancelist - Function to load a ConductanceList object (inherits from AnalogSignalList) from a file 38 generated by pyNN. Same comments that previously. load_conductancelist returns two 39 ConductanceList, one for the exc conductance and one for the inh conductance 40 load - A generic loader for all those previous load method. 30 load_vmlist - Function to load a VmList object (inherits from AnalogSignalList) from a file. 31 Same comments on format as previously. 32 load_currentlist - Function to load a CurrentList object (inherits from AnalogSignalList) from a file. 33 Same comments on format as previously. 34 load_conductancelist - Function to load a ConductanceList object (inherits from AnalogSignalList) from a file. 35 Same comments on format as previously. load_conductancelist returns two 36 ConductanceLists, one for the excitatory conductance and one for the inhibitory conductance 37 load - A generic loader for all the previous load methods. 41 38 """ 42 39 … … 58 55 import pylab 59 56 else: 60 MATPLOTLIB_ERROR = " No pylab package have beendetected"57 MATPLOTLIB_ERROR = "The pylab package was not detected" 61 58 62 59 trunk/src/visual_logging.py
r298 r311 1 1 """ 2 Visual logging 2 NeuroTools.visual_logging 3 ========================= 3 4 4 log graphs, rather than text 5 Log graphs, rather than text. This is useful when dealing with large data 6 structures, such as arrays. x-y data is plotted as a PNG file, which is stored 7 inside a zip archive. 8 9 You can specify a logging level such that only graphs with an importance above 10 that level will be created. e.g., if the logging level is set to WARNING, 11 log graphs with a level of DEBUG or INFO will not be created. 12 13 The interface is a restricted version of that available in the standard 14 library's logging module. 15 16 Functions 17 --------- 18 19 basicConfig - specify the zipfile that will be used to store the graphs, and 20 the logging level (DEBUG, INFO, WARN, etc) 21 debug - plots data with level DEBUG 22 info - plots data with level INFO 23 warning - plots data with level WARNING 24 error - plots data with level ERROR 25 critical - plots data with level CRITICAL 26 exception - plots data with level ERROR 27 log - plots data with a user-specified level 5 28 6 29 """ 30 7 31 import zipfile, atexit, os 8 32 from NeuroTools import check_dependency

