Changeset 957

Show
Ignore:
Timestamp:
05/03/11 15:44:15 (13 months ago)
Author:
apdavison
Message:

Added copyright statements

Location:
trunk
Files:
1 added
70 modified

Legend:

Unmodified
Added
Removed
  • trunk/README

    r601 r957  
    2828http://neuralensemble.org/PyNN 
    2929 
     30:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     31:license: CeCILL, see LICENSE for details. 
  • trunk/examples/nineml_neuron.py

    r955 r957  
    1212leaky_iaf = __import__("leaky_iaf") 
    1313coba_synapse = __import__("coba_synapse") 
     14import pyNN.neuron as sim 
    1415from pyNN.neuron.nineml import nineml_cell_type 
    1516from pyNN.utility import init_logging 
    16 import pyNN.neuron as sim 
     17 
    1718from copy import deepcopy 
    1819 
  • trunk/setup.py

    r935 r957  
    1515            import subprocess 
    1616            p = subprocess.Popen(nrnivmodl, shell=True, stdin=subprocess.PIPE, 
    17                          stdout=subprocess.PIPE, stderr=subprocess.PIPE, 
     17                         stdout=subprocess.PIPE, stderr=subprocess.STDOUT, 
    1818                         close_fds=True, cwd=os.path.join(os.getcwd(), self.build_lib, 'pyNN/neuron/nmodl')) 
     19            stdout = p.stdout.readlines() 
    1920            result = p.wait() 
    2021            # test if nrnivmodl was successful 
    2122            if result != 0: 
    22                 errorMsg = p.stderr.readlines() 
    23                 print "Unable to compile NEURON extensions. Error message was:" 
    24                 print errorMsg 
     23                print "Unable to compile NEURON extensions. Output was:" 
     24                print '  '.join([''] + stdout) # indent error msg for easy comprehension 
    2525            else: 
    2626                print "Successfully compiled NEURON extensions." 
     
    4141setup( 
    4242    name = "PyNN", 
    43     version = "0.7.0", 
     43    version = "0.7.1", 
    4444    package_dir={'pyNN': 'src'}, 
    45     packages = ['pyNN','pyNN.nest', 'pyNN.pcsim', 'pyNN.neuron', 'pyNN.brian', 'pyNN.nemo', 
     45    packages = ['pyNN','pyNN.nest', 'pyNN.pcsim', 'pyNN.neuron', 'pyNN.brian', 
    4646                'pyNN.recording', 'pyNN.standardmodels', 'pyNN.descriptions', 
    4747                'pyNN.nest.standardmodels', 'pyNN.pcsim.standardmodels', 
    48                 'pyNN.neuron.standardmodels', 'pyNN.brian.standardmodels', 'pyNN.nemo.standardmodels'], 
     48                'pyNN.neuron.standardmodels', 'pyNN.brian.standardmodels'], 
    4949    package_data = {'pyNN': ['neuron/nmodl/*.mod', "descriptions/templates/*/*"]}, 
    50     author = "The NeuralEnsemble Community", 
     50    author = "The PyNN team", 
    5151    author_email = "pynn@neuralensemble.org", 
    5252    description = "A Python package for simulator-independent specification of neuronal network models", 
  • trunk/src/__init__.py

    r932 r957  
    6666    random 
    6767 
     68:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     69:license: CeCILL, see LICENSE for details. 
    6870""" 
    6971 
    70 __version__ = '0.7.0 ( $Rev$)'.replace(' $','') 
     72__version__ = '0.7.1 ( $Rev$)'.replace(' $','') 
    7173__all__ = ["common", "random", "nest", "neuron", "pcsim", "brian", "nemo", "recording", "errors", "space", "descriptions", "standardmodels"] 
  • trunk/src/brian/__init__.py

    r927 r957  
    22""" 
    33Brian implementation of the PyNN API. 
     4 
     5:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     6:license: CeCILL, see LICENSE for details. 
    47 
    58$Id$ 
  • trunk/src/brian/connectors.py

    r833 r957  
    11""" 
    22Connection method classes for the brian module 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36 
    47$Id$ 
  • trunk/src/brian/electrodes.py

    r922 r957  
    55    DCSource           -- a single pulse of current of constant amplitude. 
    66    StepCurrentSource  -- a step-wise time-varying current. 
     7 
     8:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     9:license: CeCILL, see LICENSE for details. 
    710 
    811$Id$ 
  • trunk/src/brian/recording.py

    r900 r957  
     1""" 
     2 
     3:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     4:license: CeCILL, see LICENSE for details. 
     5""" 
     6 
    17import numpy 
    28import brian 
  • trunk/src/brian/simulator.py

    r926 r957  
    2323All other functions and classes are private, and should not be used by other 
    2424modules. 
    25      
     25 
     26 
     27:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     28:license: CeCILL, see LICENSE for details. 
     29 
    2630$Id$ 
    2731""" 
  • trunk/src/brian/standardmodels/cells.py

    r897 r957  
    11""" 
    22Standard cells for the brian module 
     3 
     4 
     5:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     6:license: CeCILL, see LICENSE for details. 
    37 
    48$Id$ 
  • trunk/src/brian/standardmodels/synapses.py

    r888 r957  
    11""" 
    22Synapse Dynamics classes for the brian module. 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36 
    47$Id$ 
  • trunk/src/common.py

    r941 r957  
    4141    Assembly 
    4242    Projection 
     43 
     44:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     45:license: CeCILL, see LICENSE for details. 
    4346 
    4447$Id$ 
     
    18881891            max = weights.max() 
    18891892        bins = numpy.linspace(min, max, nbins+1) 
    1890         return numpy.histogram(weights, bins, new=True)  # returns n, bins 
     1893        return numpy.histogram(weights, bins)  # returns n, bins 
    18911894 
    18921895    def describe(self, template='projection_default.txt', engine='default'): 
  • trunk/src/connectors.py

    r955 r957  
    44Simulator modules may use these directly, or may implement their own versions 
    55for improved performance. 
     6 
     7:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     8:license: CeCILL, see LICENSE for details. 
    69""" 
    710 
  • trunk/src/core.py

    r926 r957  
    11""" 
    22Assorted utility classes and functions. 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36""" 
    47 
  • trunk/src/descriptions/__init__.py

    r808 r957  
    1717from pyNN import descriptions 
    1818descriptions.DEFAULT_TEMPLATE_ENGINE = 'jinja2' 
     19 
     20 
     21:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     22:license: CeCILL, see LICENSE for details. 
    1923""" 
    2024 
  • trunk/src/errors.py

    r848 r957  
    1313    NotLocalError 
    1414    RecordingError 
     15     
     16:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     17:license: CeCILL, see LICENSE for details. 
    1518""" 
    1619 
  • trunk/src/models.py

    r888 r957  
    22Base classes for cell and synapse models, whether "standard" (cross-simulator) 
    33or "native" (restricted to an individual simulator). 
     4 
     5:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     6:license: CeCILL, see LICENSE for details. 
    47""" 
    58 
  • trunk/src/moose/__init__.py

    r893 r957  
    44 
    55Authors: Subhasis Ray and Andrew Davison 
     6 
     7:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     8:license: CeCILL, see LICENSE for details. 
    69 
    710$Id$ 
  • trunk/src/moose/cells.py

    r893 r957  
     1""" 
     2 
     3:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     4:license: CeCILL, see LICENSE for details. 
     5""" 
     6 
    17import moose 
    28import numpy 
  • trunk/src/moose/recording.py

    r900 r957  
     1""" 
     2 
     3:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     4:license: CeCILL, see LICENSE for details. 
     5""" 
     6 
    17import numpy 
    28from pyNN import recording 
  • trunk/src/moose/simulator.py

    r893 r957  
    1010All other functions and classes are private, and should not be used by other 
    1111modules. 
    12      
     12 
     13:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     14:license: CeCILL, see LICENSE for details. 
     15 
    1316$Id:$ 
    1417""" 
  • trunk/src/moose/standardmodels/cells.py

    r891 r957  
     1""" 
     2 
     3:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     4:license: CeCILL, see LICENSE for details. 
     5""" 
     6 
     7 
    18from pyNN.standardmodels import build_translations, cells 
    29from pyNN.moose.cells import StandardIF, SingleCompHH, RandomSpikeSource, VectorSpikeSource 
  • trunk/src/multisim.py

    r696 r957  
    22A small framework to make it easier to run the same model on multiple 
    33simulators. 
     4 
     5:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     6:license: CeCILL, see LICENSE for details. 
    47""" 
    58 
  • trunk/src/nemo/__init__.py

    r939 r957  
    22""" 
    33Nemo implementation of the PyNN API. 
     4 
     5:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     6:license: CeCILL, see LICENSE for details. 
    47 
    58$Id: __init__.py 927 2011-02-03 16:56:10Z pierre $ 
  • trunk/src/nemo/connectors.py

    r932 r957  
    11""" 
    22Connection method classes for the nemo module 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36 
    47$Id: connectors.py 833 2010-11-26 11:56:38Z pierre $ 
  • trunk/src/nemo/electrodes.py

    r932 r957  
    55    DCSource           -- a single pulse of current of constant amplitude. 
    66    StepCurrentSource  -- a step-wise time-varying current. 
     7 
     8:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     9:license: CeCILL, see LICENSE for details. 
    710 
    811$Id: electrodes.py 922 2011-02-02 16:41:12Z pierre $ 
  • trunk/src/nemo/recording.py

    r946 r957  
     1""" 
     2 
     3:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     4:license: CeCILL, see LICENSE for details. 
     5""" 
     6 
    17import numpy 
    28from pyNN import recording 
  • trunk/src/nemo/simulator.py

    r949 r957  
    2323All other functions and classes are private, and should not be used by other 
    2424modules. 
    25      
     25 
     26 
     27:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     28:license: CeCILL, see LICENSE for details. 
     29 
    2630$Id: simulator.py 926 2011-02-03 13:44:28Z apdavison $ 
    2731""" 
  • trunk/src/nemo/standardmodels/cells.py

    r949 r957  
    11""" 
    22Standard cells for the nemo module 
     3 
     4 
     5:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     6:license: CeCILL, see LICENSE for details. 
    37 
    48$Id: cells.py 897 2011-01-13 12:47:23Z pierre $ 
  • trunk/src/nemo/standardmodels/synapses.py

    r937 r957  
    11""" 
    22Synapse Dynamics classes for the nemo module. 
     3 
     4 
     5:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     6:license: CeCILL, see LICENSE for details. 
    37 
    48$Id: synapses.py 888 2011-01-04 15:17:54Z pierre $ 
  • trunk/src/nest/__init__.py

    r927 r957  
    22""" 
    33NEST v2 implementation of the PyNN API. 
     4 
     5:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     6:license: CeCILL, see LICENSE for details. 
    47 
    58$Id$ 
  • trunk/src/nest/cells.py

    r905 r957  
    11""" 
    22Definition of NativeCellType class for NEST. 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36""" 
    47 
  • trunk/src/nest/connectors.py

    r954 r957  
    11""" 
    22Connection method classes for nest 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36 
    47$Id$ 
  • trunk/src/nest/electrodes.py

    r922 r957  
    66    StepCurrentSource  -- a step-wise time-varying current. 
    77    NoisyCurrentSource -- a Gaussian whitish noise current. 
     8 
     9 
     10:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     11:license: CeCILL, see LICENSE for details. 
    812 
    913$Id$ 
  • trunk/src/nest/recording.py

    r931 r957  
     1""" 
     2 
     3:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     4:license: CeCILL, see LICENSE for details. 
     5""" 
     6 
    17import tempfile 
    28import os 
  • trunk/src/nest/simulator.py

    r956 r957  
    2222All other functions and classes are private, and should not be used by other 
    2323modules. 
    24      
     24 
     25 
     26:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     27:license: CeCILL, see LICENSE for details. 
     28 
    2529$Id$ 
    2630""" 
  • trunk/src/nest/standardmodels/cells.py

    r897 r957  
    11""" 
    22Standard cells for nest 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36 
    47$Id$ 
  • trunk/src/nest/standardmodels/synapses.py

    r931 r957  
    11""" 
    22Synapse Dynamics classes for nest 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36 
    47$Id$ 
  • trunk/src/nest/synapses.py

    r907 r957  
    11""" 
    22Definition of NativeSynapseType class for NEST 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36""" 
    47 
  • trunk/src/neuroml.py

    r801 r957  
    22""" 
    33PyNN-->NeuroML 
     4 
     5:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     6:license: CeCILL, see LICENSE for details. 
     7 
    48$Id$ 
    59""" 
  • trunk/src/neuron/__init__.py

    r927 r957  
    22""" 
    33nrnpython implementation of the PyNN API. 
    4   
     4 
     5:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     6:license: CeCILL, see LICENSE for details. 
     7 
    58$Id:__init__.py 188 2008-01-29 10:03:59Z apdavison $ 
    69""" 
  • trunk/src/neuron/cells.py

    r919 r957  
    22""" 
    33Standard cells for the neuron module. 
     4 
     5:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     6:license: CeCILL, see LICENSE for details. 
    47 
    58$Id$ 
  • trunk/src/neuron/connectors.py

    r770 r957  
    11""" 
    22Connection method classes for the neuron module 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36 
    47$Id$ 
  • trunk/src/neuron/electrodes.py

    r888 r957  
    55    DCSource           -- a single pulse of current of constant amplitude. 
    66    StepCurrentSource  -- a step-wise time-varying current. 
     7 
     8:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     9:license: CeCILL, see LICENSE for details. 
    710 
    811$Id$ 
  • trunk/src/neuron/nineml.py

    r955 r957  
    1313Constants: 
    1414    NMODL_DIR        - subdirectory to which NMODL mechanisms will be written 
    15      
     15 
     16:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     17:license: CeCILL, see LICENSE for details. 
     18 
    1619""" 
    1720 
     
    1922import subprocess 
    2023import neuron 
    21 from pyNN.models import BaseCellType 
    22 import nineml.abstraction_layer as nineml 
     24 
     25from pyNN.nineml.cells import join, _add_prefix, _build_nineml_celltype, NineMLCellType 
    2326import logging 
    2427import os 
    25 import re 
    26 from itertools import chain 
    2728 
    2829h = neuron.h 
     
    6970 
    7071 
    71 class NineMLCellType(BaseCellType): 
    72     model = NineMLCell 
    73      
    74     def __init__(self, parameters): 
    75         BaseCellType.__init__(self, parameters) 
    76         self.parameters["type"] = self 
    77  
    78  
    7972def _compile_nmodl(nineml_component, weight_variables): # weight variables should really be within component 
    8073    """ 
     
    9689 
    9790 
    98 def _add_prefix(synapse_model, prefix, port_map): 
    99     """ 
    100     Add a prefix to all variables in `synapse_model`, except for variables with 
    101     receive ports and specified in `port_map`. 
    102     """ 
    103     synapse_model.__cache__ = {} 
    104     exclude = [] 
    105     new_port_map = [] 
    106     for name1, name2 in port_map: 
    107         if synapse_model.ports_map[name2].mode == 'recv': 
    108             exclude.append(name2) 
    109             new_port_map.append((name1, name2)) 
    110         else: 
    111             new_port_map.append((name1, prefix + '_' + name2)) 
    112     synapse_model.add_prefix(prefix + '_', exclude=exclude) 
    113     return new_port_map 
    114  
    115  
    116 class _build_nineml_celltype(type): 
    117     """ 
    118     Metaclass for building NineMLCellType subclasses 
    119     """ 
    120     def __new__(cls, name, bases, dct): 
    121         # join the neuron and synapse components into a single component 
    122         combined_model = dct["neuron_model"] 
    123         for label in dct["synapse_models"].keys(): 
    124             port_map = dct["port_map"][label] 
    125             port_map = _add_prefix(dct["synapse_models"][label], label, port_map) 
    126             dct["weight_variables"][label] = label + "_" + dct["weight_variables"][label] 
    127             combined_model = join(combined_model, 
    128                                   dct["synapse_models"][label], 
    129                                   port_map, 
    130                                   name=name) 
    131         dct["combined_model"] = combined_model 
    132         # set class attributes required for a PyNN cell type class 
    133         dct["default_parameters"] = dict((name, 1.0) 
    134                                       for name in combined_model.parameters) 
    135         dct["default_initial_values"] = dict((name, 0.0) 
    136                                           for name in combined_model.state_variables) 
    137         dct["synapse_types"] = dct["synapse_models"].keys() #really need an ordered dict 
    138         dct["injectable"] = True # need to determine this. How?? 
    139         dct["recordable"] = [port.name for port in combined_model.analog_ports] + ['spikes', 'regime'] 
    140         dct["standard_receptor_type"] = (dct["synapse_types"] == ('excitatory', 'inhibitory')) 
    141         dct["conductance_based"] = True # how to determine this?? 
    142         dct["model_name"] = name 
    143         logger.debug("Creating class '%s' with bases %s and dictionary %s" % (name, bases, dct)) 
    144         # generate and compile NMODL code, then load the mechanism into NEUORN 
    145         _compile_nmodl(combined_model, dct["weight_variables"]) # weight variables should really be stored within combined_model 
    146         return type.__new__(cls, name, bases, dct) 
    147      
    148      
    149  
    15091def nineml_cell_type(name, neuron_model, port_map={}, weight_variables={}, **synapse_models): 
    15192    """ 
     
    15798                                   'port_map': port_map, 
    15899                                   'weight_variables': weight_variables}) 
    159  
    160  
    161 def join(c1, c2, port_map=[], name=None): 
    162     """Create a NineML component by joining the two given components.""" 
    163     logger.debug("Joining components %s and %s with port map %s" % (c1, c2, port_map)) 
    164     logger.debug("New component will have name '%s'" % name) 
    165     # combine bindings from c1 and c2 
    166     bindings = {} 
    167     for b in chain(c1.bindings, c2.bindings): 
    168         bindings[b.name] = b 
    169     # combine ports (some will later be removed) 
    170     all_ports = c1.ports_map.copy() 
    171     all_ports.update(c2.ports_map) 
    172     # event ports do not be passed to the constructor, as they are attached to transitions 
    173     for port_name, port in all_ports.items(): 
    174         if isinstance(port, nineml.EventPort): 
    175             all_ports.pop(port_name) 
    176     # connect ports. 
    177     # currently, when ports are connected they disappear. It might be better to 
    178     # explicitly keep the ports in the new component but mark them as connected 
    179     for name1, name2 in port_map: 
    180         assert name1 in c1.ports_map, "%s is not in %s" % (name1, c1.ports_map.keys()) 
    181         assert name2 in c2.ports_map, "%s is not in %s" % (name2, c2.ports_map.keys()) 
    182  
    183         port1 = c1.ports_map[name1] 
    184         port2 = c2.ports_map[name2] 
    185         assert port1.mode != port2.mode 
    186         if port1.mode == 'send': 
    187             send_port = port1 
    188             recv_port = port2 
    189             send_port_name = name1 
    190             recv_port_name = name2 
    191         else: 
    192             send_port = port2 
    193             recv_port = port1 
    194             send_port_name = name2 
    195             recv_port_name = name1 
    196         # when connecting ports in which the send port has an expression, need 
    197         # to create a binding for this expression in the new component 
    198         if send_port.expr: 
    199             func_args = c1.non_parameter_symbols.union(c2.non_parameter_symbols).intersection(send_port.expr.names) 
    200             lhs = "%s(%s)" % (send_port_name, ",".join(func_args)) 
    201             send_binding = nineml.Binding(lhs, send_port.expr.rhs) 
    202             bindings[send_binding.name] = send_binding 
    203             for eq in chain(c1.equations, c2.equations): 
    204                 if send_port_name in eq.names: 
    205                     eq.rhs = eq.rhs_name_transform({send_port_name: lhs})             
    206             if recv_port.mode == 'reduce': 
    207                 # need to retain reduce ports as they can be connected to in a future join 
    208                 if recv_port_name in bindings: 
    209                     # this reduce port has already been connected to, so combine using its reduce_op 
    210                     reduce_binding = bindings[recv_port_name] 
    211                     func_args = func_args.union(reduce_binding.args) 
    212                     lhs = "%s(%s)" % (recv_port_name, ",".join(func_args)) 
    213                     rhs = recv_port.reduce_op.join([reduce_binding.rhs, send_binding.lhs]) 
    214                 else: 
    215                     # this is the first time this reduce port has been connected to 
    216                     lhs = "%s(%s)" % (recv_port_name, ",".join(func_args)) 
    217                     rhs = send_binding.lhs 
    218                 bindings[recv_port_name] = nineml.Binding(lhs, rhs) 
    219                 recv_port.connected = True 
    220             else: 
    221                 all_ports.pop(name1) 
    222         else: 
    223             if recv_port.mode == 'reduce': 
    224                 raise NotImplementedError 
    225             else: 
    226                 all_ports.pop(name1) 
    227  
    228         if name1 != name2: 
    229             #c2.substitute(name2, name1) # need to implement this. Currently this all only works if name1 == name2 
    230                                          # probably needs to happen sooner in the function 
    231             all_ports.pop(name2) 
    232  
    233     # where parameters have become bindings due to connecting ports, replace 
    234     # bare names with function calls in the equations 
    235     for bname, binding in bindings.items(): 
    236         for eq in chain(c1.equations, c2.equations): 
    237             if bname in eq.names: 
    238                 print "#### replacing %s by %s" % (bname, binding.lhs) 
    239                 pattern = re.compile(r'%s(\([\w\, ]*\))?' % bname) 
    240                 m = pattern.search(eq.rhs) 
    241                 if m: 
    242                     eq.rhs = pattern.sub(binding.lhs, eq.rhs) 
    243                 else: 
    244                     eq.rhs = eq.rhs_name_transform({bname: binding.lhs}) 
    245  
    246     # create new regimes from all possible combinations of the regimes from the 
    247     # two components 
    248     regime_map = {} 
    249     for r1 in c1.regimes: 
    250         regime_map[r1.name] = {} 
    251         for r2 in c2.regimes: 
    252             if r1.name == r2.name: 
    253                 new_name = r1.name 
    254             else: 
    255                 new_name = "%s_AND_%s" % (r1.name, r2.name) 
    256             kwargs = {'name': new_name} 
    257             new_regime = nineml.Regime(*r1.nodes.union(r2.nodes), **kwargs) 
    258             regime_map[r1.name][r2.name] = new_regime 
    259     # create transitions between all the new regimes 
    260     transitions = [] 
    261     for r1 in c1.regimes: 
    262         for r2 in c2.regimes: 
    263             for t in r1.transitions: 
    264                 new_transition = nineml.Transition(*t.nodes, 
    265                                                    from_=regime_map[r1.name][r2.name], 
    266                                                    to=regime_map[t.to.name][r2.name], 
    267                                                    condition=t.condition) 
    268                 transitions.append(new_transition) 
    269             for t in r2.transitions: 
    270                 new_transition = nineml.Transition(*t.nodes, 
    271                                                    from_=regime_map[r1.name][r2.name], 
    272                                                    to=regime_map[r1.name][t.to.name], 
    273                                                    condition=t.condition) 
    274                 transitions.append(new_transition) 
    275  
    276     regimes = [] 
    277     for d in regime_map.values(): 
    278         regimes.extend(d.values()) 
    279     name = name or "%s__%s" % (c1.name, c2.name) 
    280     return nineml.Component(name, 
    281                             regimes=regimes, 
    282                             transitions=transitions, 
    283                             ports=all_ports.values(), 
    284                             bindings=bindings.values()) 
  • trunk/src/neuron/recording.py

    r947 r957  
     1""" 
     2 
     3:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     4:license: CeCILL, see LICENSE for details. 
     5""" 
     6 
    17import numpy 
    28from pyNN import recording 
  • trunk/src/neuron/simulator.py

    r947 r957  
    2424All other functions and classes are private, and should not be used by other 
    2525modules. 
    26      
     26 
     27:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     28:license: CeCILL, see LICENSE for details. 
     29 
    2730$Id$ 
    2831""" 
  • trunk/src/neuron/standardmodels/cells.py

    r897 r957  
    22""" 
    33Standard cells for the neuron module. 
     4 
     5:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     6:license: CeCILL, see LICENSE for details. 
    47 
    58$Id: cells.py 873 2010-12-13 22:40:03Z apdavison $ 
  • trunk/src/neuron/standardmodels/synapses.py

    r888 r957  
    11""" 
    22Synapse Dynamics classes for the neuron module. 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36 
    47$Id$ 
  • trunk/src/nineml/__init__.py

    r788 r957  
    11# encoding: utf-8 
     2""" 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
     6""" 
    27import nineml.user_layer as nineml 
    38from pyNN import common, standardmodels, random, recording 
  • trunk/src/nineml/cells.py

    r788 r957  
    11""" 
    22Standard cells for 9ML 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36""" 
    47 
  • trunk/src/nineml/connectors.py

    r771 r957  
     1""" 
     2:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     3:license: CeCILL, see LICENSE for details. 
     4""" 
     5 
    16from pyNN import connectors 
    27from utility import build_parameter_set, catalog_url 
  • trunk/src/nineml/read.py

    r955 r957  
    1010Classes: 
    1111    Network -- container for a network model. 
    12      
     12 
     13:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     14:license: CeCILL, see LICENSE for details. 
    1315""" 
    1416 
  • trunk/src/nineml/synapses.py

    r771 r957  
     1""" 
     2:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     3:license: CeCILL, see LICENSE for details. 
     4""" 
    15 
    26from utility import catalog_url 
  • trunk/src/nineml/utility.py

    r786 r957  
    11# encoding: utf-8 
     2""" 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
     6""" 
     7 
    28from pyNN import random 
    39import nineml.user_layer as nineml 
  • trunk/src/pcsim/__init__.py

    r927 r957  
    88         
    99    December 2006- 
     10 
     11:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     12:license: CeCILL, see LICENSE for details. 
     13 
    1014$Id$ 
    1115""" 
  • trunk/src/pcsim/connectors.py

    r784 r957  
    11""" 
    22Connection method classes for pcsim 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36 
    47$Id$ 
  • trunk/src/pcsim/electrodes.py

    r870 r957  
    55    DCSource           -- a single pulse of current of constant amplitude. 
    66    StepCurrentSource  -- a step-wise time-varying current. 
     7 
     8:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     9:license: CeCILL, see LICENSE for details. 
    710 
    811$Id$ 
  • trunk/src/pcsim/recording.py

    r916 r957  
     1""" 
     2:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     3:license: CeCILL, see LICENSE for details. 
     4""" 
     5 
    16import numpy 
    27import pypcsim 
  • trunk/src/pcsim/simulator.py

    r926 r957  
    2222All other functions and classes are private, and should not be used by other 
    2323modules. 
    24      
     24 
     25:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     26:license: CeCILL, see LICENSE for details. 
     27 
    2528$Id$ 
    2629""" 
  • trunk/src/pcsim/standardmodels/cells.py

    r888 r957  
    11""" 
    22Standard cells for pcsim 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36 
    47$Id$ 
  • trunk/src/pcsim/standardmodels/synapses.py

    r916 r957  
    11""" 
    22Synapse Dynamics classes for pcsim 
     3 
     4:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     5:license: CeCILL, see LICENSE for details. 
    36 
    47$Id$ 
  • trunk/src/random.py

    r912 r957  
    1212                         built-in RNG 
    1313    RandomDistribution - produces random numbers from a specific distribution 
     14 
     15 
     16:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     17:license: CeCILL, see LICENSE for details. 
    1418 
    1519$Id:random.py 188 2008-01-29 10:03:59Z apdavison $ 
  • trunk/src/recording/__init__.py

    r914 r957  
    55These classes and functions are not part of the PyNN API, and are only for 
    66internal use. 
     7 
     8:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     9:license: CeCILL, see LICENSE for details. 
    710 
    811$Id$ 
  • trunk/src/recording/files.py

    r940 r957  
    1111    NumpyBinaryFile 
    1212    HDF5ArrayFile - requires PyTables 
     13 
     14:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     15:license: CeCILL, see LICENSE for details. 
    1316 
    1417$Id$ 
  • trunk/src/space.py

    r924 r957  
    1717  Cuboid          - representation of a cuboidal volume, for use with RandomStructure. 
    1818  Sphere          - representation of a spherical volume, for use with RandomStructure. 
     19   
     20:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     21:license: CeCILL, see LICENSE for details. 
    1922""" 
    2023 
  • trunk/src/standardmodels/__init__.py

    r888 r957  
    1616    STDPWeightDependence 
    1717    STDPTimingDependence 
    18      
     18    
     19:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     20:license: CeCILL, see LICENSE for details. 
     21 
    1922""" 
    2023 
  • trunk/src/standardmodels/cells.py

    r897 r957  
    2424    SpikeSourceArray 
    2525    SpikeSourceInhGamma 
    26                 
     26 
     27:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     28:license: CeCILL, see LICENSE for details. 
    2729""" 
    2830 
  • trunk/src/standardmodels/synapses.py

    r901 r957  
    1313    GutigWeightDependence 
    1414    SpikePairRule 
    15      
     15 
     16:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     17:license: CeCILL, see LICENSE for details. 
    1618""" 
    1719 
  • trunk/src/utility.py

    r907 r957  
    1212    Timer    - a convenience wrapper around the time.time() function from the 
    1313               standard library. 
     14 
     15:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS. 
     16:license: CeCILL, see LICENSE for details. 
    1417 
    1518$Id$