Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: INM-6/hybridLFPy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2rc0
Choose a base ref
...
head repository: INM-6/hybridLFPy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 13 commits
  • 39 files changed
  • 1 contributor

Commits on Jun 17, 2021

  1. add numpy and Cython to python-publish action (#62)

    * add numpy and Cython to python-publish action
    
    * bump rc version
    espenhgn authored Jun 17, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    534fa96 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d127f01 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c81d276 View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e68806c View commit details
  5. release 0.2 (#66)

    * use Zenodo DOI from github.com/LFPy/hybridLFPy fork
    
    * bump version to 0.2
    espenhgn authored Jun 17, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c46f16e View commit details

Commits on Jun 24, 2021

  1. Dockerfile cleanup (#69)

    espenhgn authored Jun 24, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    aeef5d1 View commit details

Commits on Jul 1, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4d6cdfd View commit details
  2. Fix #68 (#71)

    * remove build dir
    espenhgn authored Jul 1, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6b31df9 View commit details

Commits on Jul 2, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4254e56 View commit details

Commits on Aug 31, 2022

  1. ignore presynaptic nodes with zero probability for being drawn (#78)

    * ignore presynaptic nodes with zero probability for being drawn
    
    * more compact
    
    * minifix
    espenhgn authored Aug 31, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d61f27b View commit details

Commits on Apr 19, 2023

  1. Reduce memory footprint (#81)

    * sum probe signals incrementally
    
    * fixed deprecated code
    espenhgn authored Apr 19, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2435ced View commit details

Commits on Apr 23, 2023

  1. Reduce memory footprint (#82)

    * sum probe signals incrementally
    
    * fixed deprecated code
    
    * double precision
    espenhgn authored Apr 23, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    01ec571 View commit details

Commits on May 2, 2023

  1. Fix misc. deprecated codes (#83)

    * set up Docker image w. NEST-3.1
    
    * misc
    
    * fixed misc. code issues.
    
    * move nest import
    
    * relocate import nest
    
    * updated Dockerfile
    espenhgn authored May 2, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    479c2c4 View commit details
Showing with 434 additions and 265 deletions.
  1. +1 −1 .github/workflows/python-publish.yml
  2. +68 −76 Dockerfile
  3. +56 −63 README.md
  4. +54 −52 docs/index.rst
  5. +4 −7 environment.yml
  6. +5 −4 examples/Hagen_et_al_2016_cercor/Dockerfile
  7. +2 −2 examples/Hagen_et_al_2016_cercor/figure_01.py
  8. +2 −4 examples/brunel_alpha_nest.py
  9. +4 −4 examples/brunel_alpha_nest_topo_exp.py
  10. +3 −6 examples/example_brunel.py
  11. +2 −2 examples/example_brunel_alpha_topo_exp.py
  12. +1 −1 examples/example_microcircuit.py
  13. +1 −1 examples/example_microcircuit_lognormalweights.py
  14. +4 −2 examples/example_microcircuit_params.py
  15. +4 −2 examples/example_microcircuit_params_lognormalweights.py
  16. +1 −1 examples/example_plotting.py
  17. +12 −0 examples/morphologies/ballnsticks/L23E_p23.swc
  18. +10 −0 examples/morphologies/ballnsticks/L23I_b23.swc
  19. +10 −0 examples/morphologies/ballnsticks/L23I_nb23.swc
  20. +12 −0 examples/morphologies/ballnsticks/L4E_p4.swc
  21. +10 −0 examples/morphologies/ballnsticks/L4E_ss4(L23).swc
  22. +10 −0 examples/morphologies/ballnsticks/L4E_ss4(L4).swc
  23. +10 −0 examples/morphologies/ballnsticks/L4I_b4.swc
  24. +10 −0 examples/morphologies/ballnsticks/L4I_nb4.swc
  25. +12 −0 examples/morphologies/ballnsticks/L5E_p5(L23).swc
  26. +12 −0 examples/morphologies/ballnsticks/L5E_p5(L56).swc
  27. +10 −0 examples/morphologies/ballnsticks/L5I_b5.swc
  28. +10 −0 examples/morphologies/ballnsticks/L5I_nb5.swc
  29. +12 −0 examples/morphologies/ballnsticks/L6E_p6(L4).swc
  30. +12 −0 examples/morphologies/ballnsticks/L6E_p6(L56).swc
  31. +10 −0 examples/morphologies/ballnsticks/L6I_b6.swc
  32. +10 −0 examples/morphologies/ballnsticks/L6I_nb6.swc
  33. +12 −0 examples/morphologies/ex.swc
  34. +10 −0 examples/morphologies/in.swc
  35. +1 −10 hybridLFPy/gdf.py
  36. +4 −2 hybridLFPy/helperfun.pyx
  37. +19 −24 hybridLFPy/population.py
  38. +1 −1 hybridLFPy/version.py
  39. +3 −0 setup.py
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools twine
pip install setuptools twine numpy Cython
- name: Build and publish to Test PYPI
env:
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
144 changes: 68 additions & 76 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,102 +1,94 @@
# -------- base ---------
FROM debian:bullseye-slim AS base
FROM buildpack-deps:jammy

RUN apt-get update && \
apt-get install -y \
wget \
bash \
build-essential \
make \
gcc \
g++ \
git \
libncurses-dev \
python3 \
python3-numpy \
python3-scipy \
python3-matplotlib \
python3-h5py \
python3-yaml \
python3-pytest \
python3-pip \
cython3 \
jupyter \
ipython3

RUN pip3 install --upgrade pip

# ------ NEURON -----------

FROM base AS neuron

RUN pip3 install neuron


# ----- LFPy ---------

FROM neuron AS lfpy

RUN apt-get update && \
apt-get install -y \
python3-mpi4py

RUN pip3 install git+https://github.com/LFPy/LFPy.git@v2.2.1#egg=LFPy


# --- NEST ----

FROM lfpy AS nest

ARG WITH_MPI=ON
ARG WITH_OMP=ON
ARG WITH_GSL=ON

RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
libgsl-dev \
libltdl7 \
libltdl-dev \
libreadline8 \
libreadline-dev \
libmpich-dev \
mpich \
doxygen \
libboost-dev \
libopenmpi-dev \
doxygen
libgsl-dev \
cython3 \
python3-dev \
python3-pip \
python3-numpy

RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && \
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10

RUN pip install mpi4py

# Install NEST 3 (master branch @v3.0)
RUN wget https://github.com/nest/nest-simulator/archive/v3.0.tar.gz && \
# Install NEST 3.4 (master branch @v3.4)
RUN git clone --depth 1 -b v3.4 https://github.com/nest/nest-simulator && \
mkdir nest-build && \
tar zxf v3.0.tar.gz && \
mv nest-simulator-3.0 nest-simulator && \
cd nest-build && \
cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/nest/ \
-Dwith-boost=ON \
-Dwith-ltdl=ON \
-Dwith-gsl=$WITH_GSL \
-Dwith-readline=ON \
-Dwith-ltdl=ON \
-Dwith-gsl=ON \
-Dwith-readline=ON \
-Dwith-python=ON \
-Dwith-mpi=$WITH_MPI \
-Dwith-openmp=$WITH_OMP \
-Dwith-mpi=ON \
-Dwith-openmp=ON \
../nest-simulator && \
make -j4 && \
make install && \
cd -

RUN echo "source /opt/nest/bin/nest_vars.sh" >> root/.bashrc
cd ..

# clean up install/build files
RUN rm v3.0.tar.gz
RUN rm -r nest-simulator
RUN rm -r nest-build


# ---- additional requirements
RUN apt-get install -y \
python3-numpy \
python3-scipy \
python3-matplotlib \
python3-pandas \
ipython3 \
jupyter

RUN update-alternatives --install /usr/bin/ipython ipython /usr/bin/ipython3 10

# --- hybridLFPy ----
# installing serial h5py (deb package installs OpenMPI which may conflict with MPICH)
RUN pip install h5py

FROM nest AS hybridlfpy

RUN pip3 install git+https://github.com/INM-6/hybridLFPy.git@master#egg=hybridLFPy
# ---- install neuron -----
RUN apt-get install -y \
bison flex

RUN git clone --depth 1 -b 8.2.2 https://github.com/neuronsimulator/nrn.git
RUN mkdir nrn-bld && cd nrn-bld

# ---- hybridLFPy + examples ----
RUN cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/nrn/ \
-DCURSES_NEED_NCURSES=ON \
-DNRN_ENABLE_INTERVIEWS=OFF \
-DNRN_ENABLE_MPI=ON \
-DNRN_ENABLE_RX3D=OFF \
-DNRN_ENABLE_PYTHON=ON \
../nrn

FROM hybridlfpy AS examples
RUN cmake --build . --parallel 4 --target install && \
cd ..

# add nrnpython to PYTHONPATH
ENV PYTHONPATH /opt/nrn/lib/python:${PYTHONPATH}


# --- Install hybridLFPy ----
RUN pip install git+https://github.com/INM-6/hybridLFPy.git@master#egg=hybridLFPy


# ---- Install additional dependencies for examples ----
RUN pip3 install git+https://github.com/NeuralEnsemble/parameters@b95bac2bd17f03ce600541e435e270a1e1c5a478


# Add NEST environment variables
RUN echo "source /opt/nest/bin/nest_vars.sh" >> root/.bashrc

# If running with Singularity, run the below line in the host.
# PYTHONPATH set here doesn't carry over:
# export SINGULARITYENV_PYTHONPATH=/opt/nest/lib/python3.9/site-packages
# Alternatively, run "source /opt/local/bin/nest_vars.sh" while running the container
119 changes: 56 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,125 +1,118 @@
# Module `hybridLFPy`
# hybridLFPy

Python module implementating a hybrid model scheme for predictions of
Python module implementing a hybrid scheme for predictions of
extracellular potentials (local field potentials, LFPs) of spiking
neuron network simulations.


## Project Status

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.45185.svg)](https://doi.org/10.5281/zenodo.45185)
[![DOI](https://zenodo.org/badge/36443206.svg)](https://zenodo.org/badge/latestdoi/36443206)
[![Documentation Status](https://readthedocs.org/projects/hybridlfpy/badge/?version=latest)](https://hybridLFPy.readthedocs.io/en/latest/?badge=latest)
[![Upload Python Package](https://github.com/INM-6/hybridLFPy/workflows/Upload%20Python%20Package/badge.svg)](https://pypi.org/project/hybridLFPy)
[![Python pytest](https://github.com/INM-6/hybridLFPy/workflows/Python%20pytest/badge.svg)](https://github.com/INM-6/hybridLFPy/actions/workflows/python-pytest.yml)
[![License](http://img.shields.io/:license-GPLv3+-green.svg)](http://www.gnu.org/licenses/gpl-3.0.html)


## Development
## Development

The module hybridLFPy was mainly developed in the Computational Neuroscience
Group (http://compneuro.umb.no), Department of Mathemathical Sciences and
Technology (http://www.nmbu.no/imt), at the Norwegian University of Life
Sciences (http://www.nmbu.no), Aas, Norway, in collaboration with Institute of
Group (<http://compneuro.umb.no>), Department of Mathemathical Sciences and
Technology (<http://www.nmbu.no/imt>), at the Norwegian University of Life
Sciences (<http://www.nmbu.no>), Aas, Norway, in collaboration with Institute of
Neuroscience and Medicine (INM-6) and Institute for Advanced Simulation (IAS-6),
Juelich Research Centre and JARA, Juelich, Germany
(http://www.fz-juelich.de/inm/inm-6/EN/).

(<http://www.fz-juelich.de/inm/inm-6/EN/>).

## Citation

Should you find `hybridLFPy` useful for your research, please cite the following paper:
```
Espen Hagen, David Dahmen, Maria L. Stavrinou, Henrik Lindén, Tom Tetzlaff,
Sacha J. van Albada, Sonja Grün, Markus Diesmann, Gaute T. Einevoll;
Hybrid Scheme for Modeling Local Field Potentials from Point-Neuron Networks,
Cerebral Cortex, Volume 26, Issue 12, 1 December 2016, Pages 4461–4496,
https://doi.org/10.1093/cercor/bhw237
```
Should you find `hybridLFPy` useful for your research, please cite the
following paper:

Espen Hagen, David Dahmen, Maria L. Stavrinou, Henrik Lindén, Tom Tetzlaff,
Sacha J. van Albada, Sonja Grün, Markus Diesmann, Gaute T. Einevoll;
Hybrid Scheme for Modeling Local Field Potentials from Point-Neuron Networks,
Cerebral Cortex, Volume 26, Issue 12, 1 December 2016, Pages 4461–4496,
https://doi.org/10.1093/cercor/bhw237

Bibtex source:
```
@article{doi:10.1093/cercor/bhw237,
author = {Hagen, Espen and Dahmen, David and Stavrinou, Maria L. and Lindén, Henrik and Tetzlaff, Tom and van Albada, Sacha J. and Grün, Sonja and Diesmann, Markus and Einevoll, Gaute T.},
title = {Hybrid Scheme for Modeling Local Field Potentials from Point-Neuron Networks},
journal = {Cerebral Cortex},
volume = {26},
number = {12},
pages = {4461-4496},
year = {2016},
doi = {10.1093/cercor/bhw237},
URL = { + http://dx.doi.org/10.1093/cercor/bhw237},
eprint = {/oup/backfile/content_public/journal/cercor/26/12/10.1093_cercor_bhw237/2/bhw237.pdf}
}
```

@article{doi:10.1093/cercor/bhw237,
author = {Hagen, Espen and Dahmen, David and Stavrinou, Maria L. and Lindén,
Henrik and Tetzlaff, Tom and van Albada, Sacha J. and Grün, Sonja and
Diesmann, Markus and Einevoll, Gaute T.},
title = {Hybrid Scheme for Modeling Local Field Potentials from
Point-Neuron Networks},
journal = {Cerebral Cortex},
volume = {26},
number = {12},
pages = {4461-4496},
year = {2016},
doi = {10.1093/cercor/bhw237},
URL = { + http://dx.doi.org/10.1093/cercor/bhw237},
eprint = {/oup/backfile/content_public/journal/cercor/26/12/10.1093_cercor_bhw237/2/bhw237.pdf}
}

## License

This software is released under the General Public License (see the [LICENSE](https://github.com/INM-6/hybridLFPy/blob/master/LICENSE) file).

This software is released under the General Public License (see the
[LICENSE](https://github.com/INM-6/hybridLFPy/blob/master/LICENSE) file).

## Warranty

This software comes without any form of warranty.


## Installation

First download all the `hybridLFPy` source files using `git`
(http://git-scm.com). Open a terminal window and type:
```
cd $HOME/where/to/put/hybridLFPy
git clone https://github.com/INM-6/hybridLFPy.git
```
(<http://git-scm.com>). Open a terminal window and type:

cd $HOME/where/to/put/hybridLFPy
git clone https://github.com/INM-6/hybridLFPy.git

To use `hybridLFPy` from any working folder without copying files, run:
```
(sudo) pip install -e . (--user)
```

(sudo) pip install -e . (--user)

Installing it is also possible, but not recommended as things might change with
future pulls from the repository:
```
(sudo) pip install . (--user)
```

(sudo) pip install . (--user)

### examples folder

Some example script(s) on how to use this module


### docs folder

Source files for autogenerated documentation using `Sphinx` (https://www.sphinx-doc.org).
Source files for autogenerated documentation using `Sphinx`
(<https://www.sphinx-doc.org>).

To compile documentation source files in this directory using sphinx, use:
```
sphinx-build -b html docs documentation
```

sphinx-build -b html docs documentation

### Dockerfile

The provided `Dockerfile` provides a Docker container recipe for `x86_64` hosts
with all dependencies required to run simulation files provided in `examples`.
To build and run the container locally, get Docker from https://www.docker.com
To build and run the container locally, get Docker from <https://www.docker.com>
and issue the following (replace `<image-name>` with a name of your choosing):

$ docker build -t <image-name> -< Dockerfile
$ docker run -it -p 5000:5000 <image-name>:latest

docker build -t <image-name> -< Dockerfile
docker run -it -p 5000:5000 <image-name>:latest

The `--mount` option can be used to mount a folder on the host to a target folder as:
The `--mount` option can be used to mount a folder on the host to a target
folder as:

$ docker run --mount type=bind,source="$(pwd)",target=/opt/hybridLFPy -it -p 5000:5000 <image-name>
docker run --mount type=bind,source="$(pwd)",target=/opt/hybridLFPy \
-it -p 5000:5000 <image-name>

Then, code examples may be run as:

$ cd /opt/hybridLFPy/examples
$ nrnivmodl # compile local .mod (NMODL) files
$ mpirun --allow-run-as-root python3 example_brunel.py

cd /opt/hybridLFPy/examples
nrnivmodl # compile local .mod (NMODL) files
mpirun --allow-run-as-root python3 example_brunel.py

## Online documentation

The sphinx-generated html documentation can be accessed at
https://hybridLFPy.readthedocs.io
<https://hybridLFPy.readthedocs.io>
Loading