Metadata-Version: 2.1
Name: teili
Version: 0.9.2
Summary: This toolbox was developed to provide computational  neuroscientists and neuromorphic engineers with a playground for implementing neural algorithms which are simulated using Brian 2.
Home-page: https://code.ini.uzh.ch/ncs/teili
Author: Moritz B. Milde
Author-email: m.milde@westernsydney.edu.au
License: MIT
Keywords: Neural algorithms,building blocks,Spiking Neural Networks
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/markdown
Requires-Dist: setuptools (>=39.2.0)
Requires-Dist: numpy (>=1.15.1)
Requires-Dist: seaborn (>=0.8.1)
Requires-Dist: sparse (>=0.3.0)
Requires-Dist: Brian2 (==2.2.2.1)
Requires-Dist: scipy (>=1.1.0)
Requires-Dist: pyqtgraph (>=0.10.0)
Requires-Dist: pandas (>=0.23.1)
Requires-Dist: matplotlib (>=2.2.2)
Requires-Dist: h5py (>=2.8.0)
Requires-Dist: pyqt5 (>=5.10.1)

<p align="center">
 <a href='https://teili.readthedocs.io/en/latest/?badge=latest' alt="Documentation Status">
    <img src='https://readthedocs.org/projects/teili/badge/?version=latest' /></a>
 <a href="https://code.ini.uzh.ch/ncs/teili/commits/dev" alt="build status">
       <img src="https://code.ini.uzh.ch/ncs/teili/badges/dev/build.svg" /></a>
 <a href="https://code.ini.uzh.ch/ncs/teili/commits/dev" alt="Coverage">
       <img src="https://code.ini.uzh.ch/ncs/teili/badges/dev/coverage.svg" /></a>
</p>

# teili

teili, das /taɪli/, Swiss german diminutive for piece. <br />

This toolbox was developed to provide computational neuroscientists and neuromorphic engineers with a playground for implementing neural algorithms which are simulated using **brian2**.<br />
Please report issues via the gitlab [issue tracker](https://code.ini.uzh.ch/ncs/teili/issues). You can find the documentation [here](https://teili.readthedocs.io/en/latest/).


By providing pre-defined neural algorithms, a contributing guide to create novel neural algorithms and an intuitive way to combine different aspects of those neural algorithms, e.g. plasticity, connectivity etc, we try to shorten the development time required to test and implement novel neural algorithms and hierarchically assemble them.
Furthermore, by providing an easy and modular way to construct those algorithms from the basic building blocks of computaton, e.g. neurons, synapses and EI-networks, we aim to promote the development of reproducible computational models and networks thereof. 
Additionally we aim to reduce the gap between software simulation and specific hardware emulation/implementation by an easy way to switch neuron/synapse models in a highly complex building block of a developed neural algorithm.

## Getting Started

This toolbox is still in its alpha phase, so if you want to use it, follow the install instructions below.
Please also contact the main contributors with feedback.

Please look at the examples here: `~/teiliApps/tutorials/` after successfully installing **teili** and our [Documentation](https://teili.readthedocs.io/en/latest/)

### Installation

* Create a virtual environment using [conda](https://conda.io/docs/user-guide/install/index.html)
    ``` bash
    # Replace myenv with the desired name for your virtual environment
    conda create --name myenv python=3.7
    ```
  If you want to use a specific version, as needed e.g. to use [CTXLCTL](http://ai-ctx.gitlab.io/ctxctl/index.html) add the particular python version to the conda environment
   ``` bash
   conda create --name myenv python=3.6.6
   ```

*  Activate your conda environment
    ``` bash
    source activate myenv
    ```

*  If you want to use the stable release simply run:

    ```
    pip install teili
    ```

*  If you want to work with the latest version of **teili** clone the [repository](https://code.ini.uzh.ch/ncs/teili) or [download](https://code.ini.uzh.ch/ncs/teili) the tar.gz file<br />
    ``` bash
    git clone https://code.ini.uzh.ch/ncs/teili.git
    ```
*  Navigate to the parent folder containing the cloned repository or the downloaded `tar.gz` file
    ```
    cd Downloads/
    ```
*  Install teili using pip
    ``` bash
    # Point pip to the location of the setup.py
    pip install teili/
    # or point pip to the downloaded tar.gz file
    pip install teili*.tar.gz
    ```
    The `setup.py` will by default create a folder in your home directory called `teiliApps`.
    This folder contains a selection of neuron and synapse models, example scripts, as well as unit tests.
    Please run the unit tests to check if everything is working. As we test also plotting functionality of teili we generate and kill plotting windows which causes warnings.

    ``` bash
    cd ~/teiliApps/
    python -m unittest discover unit_tests/
    ```

If you run the aboive command and the last line states ``Ran 78 tests in 93.373 OK``, everything is good. You are good to go!<br />

We would recommend using [iPython](https://pypi.org/project/ipython/) with [Spyder](https://www.spyder-ide.org/) or[Jupyter](https://pypi.org/project/jupyter/) as IDE, but any other editior/IDE is fine as well.

You probably need to use Linux if you want to use standalone code generation,
otherwise, Windows and Mac OSX works fine.

## Basic usage

``` python
from brian2 import ms
from teili import Neurons, Connections
from teili.models.neuron_models import DPI
from teili.models.synapse_models import DPISyn

# how to create a Neuron
num_neurons = 10
refP = 3 * ms
Neuron1 = Neurons(num_neurons, equation_builder=DPI(numInputs=1),
                  refractory=refP, name='Neuron1')

# how to create a Synapse
Synapse1 = Connections(Neuron1, Neuron1,
                      equation_builder=DPISyn(),
                      method='euler',
                      name='Synapse1')
```
For a more detailed explanation have a look at our [Tutorial](https://teili.readthedocs.io/en/latest/scripts/Tutorials.html)

### Tutorials
Please look at the [Neuron & Synapse tutorial](https://teili.readthedocs.io/en/latest/scripts/Tutorials.html#neuron-synapse-tutorial), which is located in `~/teiliApps/tutorial/`.
You can also use them to test your installation.
To run an example and test if eveything is working, run the following command

``` bash
cd ~/teiliApps/examples/
python3 neuron_synapse_test.py
```
For more examples and use cases have look at our [Documentation](https://teili.readthedocs.io/en/latest/index.html)


## Brian2 debugging tips
Simulation is not going as expected?
* Restart Python kernel
* Are all groups added to the network?
* Are all statevars initialized with the correct value? (e.g. Membrane potential with resting potential, not 0)
* Use group.print() in order to see the equations
* Use connections.plot() in order to get a visualization



## Authors
See here for a [list of the authors](https://teili.readthedocs.io/en/latest/scripts/Contributors.html).


## License
_teili_ is licenced under the MIT license, see the `LICENSE` file.



