General Instructions
Installation
spikeanalysis is currently in alpha and so can not be installed
from pypi or conda-forge. Instead it is built with the included
environment.yml
(base) $ conda create env -f environment.yml
Alternatively if working in a non-conda system. Pip installation works as well. In
this case you can create whatever desired virtual environment followed by installing
the requirements file requirements.txt. Note this requires having git
installed. To do this installation (note it is recommended to create some kind of
virtual environment choose whatever you want):
$ pip install -r requirements.txt
$ pip install git+https://github.com/NeuralEnsemble/python-neo.git
$ pip install git+https://github.com/zm711/spikeanalysis.git
Dependencies
Required
numpy
scipy
matplotlib
numba
pandas
neo
tqdm
Optional (included in environment.yml)
seaborn
scikit-learn
For someone wanting to build their own environment and does not need full functionality There are only five required packages:
numpy
scipy
numba
neo
tqdm
plotting functions require matplotlib to function
I prefer to build Neo from source since it is still actively being developed and I’m
working to update the IntanRawIO.
Optional Dependency Explanations
matplotlib is import for the two plotting classes pandas is currently only used for one correlation function, but I plan to add a class that uses pandas or polar extensively. seaborn is mostly unused, but I may make more use of it in the future sklearn is completely unused, but I have plans for it.
Development
Since spikeanalysis is still in alpha development, there is a separate environment_dev.yml, which
will create an environment called spikeanalysis_dev with all the dependencies above with the additions
of:
black
pytest
pytest-cov
In order to install in editable mode the yml does not install spikeanalysis itself, so one should
do the following
(base) $ conda create env -f environment_dev.yml
(base) $ git clone https://github.com/zm711/spikeanalysis
(base) $ cd spikeanalysis
(base) $ conda activate spikeanalysis_dev
(spikeanalysis_dev) $ pip install -e .
Commits and Testing
Before committing any code lint with Black. This can be done within the dev environment. Of note
--exclude params.py, must be included since this data requires ' ' and Black will
switch them to " ". the params.py is part of the stimulated data for testing.
(spikeanalysis_dev) $ black spikeanalysis --exclude params.py
Testing should be done with pytest and pytest-cov. Optionally the flag for missing lines
can be included for coverage with --cov-report term-missing.
(spikeanalysis_dev) $ cd path/to/spikeanalysis
(spikeanalysis_dev) $ pytest --cov-config=pyproject.tom. --cov=spikenalysis