Changeset 707

Show
Ignore:
Timestamp:
02/12/10 11:29:45 (2 years ago)
Author:
apdavison
Message:

Some documentation updates

Location:
trunk/doc
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/doc/highlevelapi.txt

    r701 r707  
    258258Again, 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. 
    259259 
    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:: 
     260It 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:: 
    261261 
    262262    >>> h5file = recording.files.HDF5ArrayFile("spikefile.h5", "w") 
     
    393393The 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``. 
    394394 
    395 The calculation of distance may be controlled by specifying a `Space` object. 
     395The calculation of distance may be controlled by specifying a ``Space`` object. 
    396396 
    397397By default, the 3D distance between cell positions is used, but the ``axes`` argument may be used to change this, e.g.:: 
     
    516516    >>> prj1_1.randomizeDelays(delay_distr) 
    517517 
    518 ## NOTE: Need to add information about getting/setting individual weights and delays 
     518It 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     
     524In general, though, this is less efficient than using list- or array-based access. 
    519525 
    520526Accessing weights and delays 
  • trunk/doc/lowlevelapi.txt

    r629 r707  
    2525    >>> setup() 
    2626     
    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     
     31In 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     
     36or you can configure the Python ``logging`` module directly. 
    3237 
    3338Creating neurons 
     
    8186    >>> create(IF_curr_alpha, cellparams={'tau_m': 'bar'}) 
    8287    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 
    8493        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) 
    93101     
    94102If 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.:: 
     
    180188     
    181189Positions 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. 
     190No specific coordinate system or scale of units is assumed, although many parts of PyNN do assume a Euclidean coordinate system. 
    183191 
    184192Injecting current 
     
    235243In this case, use the ``compatible_output=False`` argument to the ``end()`` function. 
    236244 
    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 output formats. 
     245For recording to binary (e.g. HDF5) rather than text files, see the chapter on file formats. 
    238246 
    239247Running a simulation 
     
    244252    >>> run(1000.0) 
    245253     
     254 
     255Repeating a simulation 
     256====================== 
     257 
     258If you wish to reset network time to zero to run a new simulation with the same 
     259network (with different parameter values, perhaps), use the ``reset()`` function. 
     260Note that this does not change the network structure, nor the choice of which 
     261neurons to record (from previous ``record()`` calls). 
     262 
     263     
    246264Finishing up 
    247265============ 
  • trunk/doc/testdocs.py

    r637 r707  
    1010 
    1111optionflags = doctest.IGNORE_EXCEPTION_DETAIL+doctest.NORMALIZE_WHITESPACE 
     12#optionflags = doctest.NORMALIZE_WHITESPACE 
    1213 
    1314class MyOutputChecker(doctest.OutputChecker):