Changeset 707
- Timestamp:
- 02/12/10 11:29:45 (2 years ago)
- Location:
- trunk/doc
- Files:
-
- 1 added
- 3 modified
-
fileformats.txt (added)
-
highlevelapi.txt (modified) (3 diffs)
-
lowlevelapi.txt (modified) (5 diffs)
-
testdocs.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/highlevelapi.txt
r701 r707 258 258 Again, there is a performance penalty for this, so if you wish each node to write its own file, add ``gather=False`` to the argument list. 259 259 260 It is possible to save data in various different formats. The default (if you pass a filename) is a text file, but you can also save in various binary formats. To save in HDF5 format , for example::260 It is possible to save data in various different formats. The default (if you pass a filename) is a text file, but you can also save in various binary formats. To save in HDF5 format (this requires the PyTables package to be installed), for example:: 261 261 262 262 >>> h5file = recording.files.HDF5ArrayFile("spikefile.h5", "w") … … 393 393 The second example connects each neuron to all its neighbours within a range of 3 units (distance is in µm if positions have been specified, in array coordinate distance otherwise). Note that boolean values ``True`` and ``False`` are automatically converted to numerical values ``1.0`` and ``0.0``. 394 394 395 The calculation of distance may be controlled by specifying a ` Space` object.395 The calculation of distance may be controlled by specifying a ``Space`` object. 396 396 397 397 By default, the 3D distance between cell positions is used, but the ``axes`` argument may be used to change this, e.g.:: … … 516 516 >>> prj1_1.randomizeDelays(delay_distr) 517 517 518 ## NOTE: Need to add information about getting/setting individual weights and delays 518 It is also possible to access the attributes of individual connections using the 519 ``connections`` attribute of a projection:: 520 521 >>> for c in prj1_1.connections[:5]: 522 ... c.weight *= 2 523 524 In general, though, this is less efficient than using list- or array-based access. 519 525 520 526 Accessing weights and delays -
trunk/doc/lowlevelapi.txt
r629 r707 25 25 >>> setup() 26 26 27 ``setup()`` takes various optional arguments: setting the simulation timestep (there is currently no support in the API for variable timestep methods although native simulator code can be used to select this option where the simulator supports it), setting the minimum and maximum synaptic delays, and turning debugging output on and off, e.g.:: 28 29 >>> setup(timestep=0.1, min_delay=0.1, max_delay=0.5, debug=False) 30 31 Debugging information is written to a log file in the working directory. 27 ``setup()`` takes various optional arguments: setting the simulation timestep (there is currently no support in the API for variable timestep methods although native simulator code can be used to select this option where the simulator supports it) and setting the minimum and maximum synaptic delays, e.g.:: 28 29 >>> setup(timestep=0.1, min_delay=0.1, max_delay=0.5) 30 31 In previous versions, ``setup()`` took a ``debug`` argument for configuring logging. To allow more flexibility, configuration of logging must now be done separately. There is a convenience function in the ``pyNN.utility`` module to simplify this:: 32 33 >>> from pyNN.utility import init_logging 34 >>> init_logging("logfile", debug=True) 35 36 or you can configure the Python ``logging`` module directly. 32 37 33 38 Creating neurons … … 81 86 >>> create(IF_curr_alpha, cellparams={'tau_m': 'bar'}) 82 87 Traceback (most recent call last): 83 File "/usr/lib/python/site-packages/pyNN/nest1.py", line 228, in create 88 File "<stdin>", line 1, in ? 89 create(IF_curr_alpha, cellparams={'tau_m': 'bar'}) 90 File "/usr/lib/python/site-packages/pyNN/common.py", line 655, in create 91 all_cells, mask_local, first_id, last_id = simulator.create_cells(cellclass, cellparams, n) 92 File "/usr/lib/python/site-packages/pyNN/neuron/simulator.py", line 287, in create_cells 84 93 celltype = cellclass(cellparams) 85 File "/usr/lib/python/site-packages/pyNN/nest1.py", line 68, in __init__ 86 common.IF_curr_alpha.__init__(self,parameters) # checks supplied parameters and adds default 87 File "/usr/lib/python/site-packages/pyNN/common.py", line 113, in __init__ 88 self.parameters = self.checkParameters(parameters, with_defaults=True) 89 File "/usr/lib/python/site-packages/pyNN/common.py", line 90, in checkParameters 90 raise InvalidParameterValueError, (type(supplied_parameters[k]), type(default_parameters[k])) 91 InvalidParameterValueError: (<type 'str'>, <type 'float'>) 92 94 File "/usr/lib/python/site-packages/pyNN/neuron/cells.py", line 442, in __init__ 95 cells.IF_curr_alpha.__init__(self, parameters) # checks supplied parameters and adds default 96 File "/usr/lib/python/site-packages/pyNN/common.py", line 460, in __init__ 97 self.parameters = self.__class__.checkParameters(parameters, with_defaults=True) 98 File "/usr/lib/python/site-packages/pyNN/common.py", line 494, in checkParameters 99 raise InvalidParameterValueError(err_msg) 100 InvalidParameterValueError: For tau_m in IF_curr_alpha, expected <type 'float'>, got <type 'str'> (bar) 93 101 94 102 If you wish to do something with the cell after creating it: record from it, change a parameter, connect it to another cell, you should assign the return value of the function to a variable, e.g.:: … … 180 188 181 189 Positions must always be in 3D, and may be given as integers or floating-point values, and as tuples or as numpy arrays. 182 No specific scale of units is assumed, although many parts of PyNN do assume a Euclidean coordinate system.190 No specific coordinate system or scale of units is assumed, although many parts of PyNN do assume a Euclidean coordinate system. 183 191 184 192 Injecting current … … 235 243 In this case, use the ``compatible_output=False`` argument to the ``end()`` function. 236 244 237 Considerable enhancements to file formats are planned for future releases of PyNN, including recording to binary (HDF5) rather than text files, support for variable time-step recording, and user-specified outputformats.245 For recording to binary (e.g. HDF5) rather than text files, see the chapter on file formats. 238 246 239 247 Running a simulation … … 244 252 >>> run(1000.0) 245 253 254 255 Repeating a simulation 256 ====================== 257 258 If you wish to reset network time to zero to run a new simulation with the same 259 network (with different parameter values, perhaps), use the ``reset()`` function. 260 Note that this does not change the network structure, nor the choice of which 261 neurons to record (from previous ``record()`` calls). 262 263 246 264 Finishing up 247 265 ============ -
trunk/doc/testdocs.py
r637 r707 10 10 11 11 optionflags = doctest.IGNORE_EXCEPTION_DETAIL+doctest.NORMALIZE_WHITESPACE 12 #optionflags = doctest.NORMALIZE_WHITESPACE 12 13 13 14 class MyOutputChecker(doctest.OutputChecker):
