Skip to content

Commit

Permalink
Merge branch 'jonescompneurolab:master' into delete_drive
Browse files Browse the repository at this point in the history
  • Loading branch information
raj1701 authored Mar 7, 2023
2 parents e32ddbc + a4493c1 commit 1e05e11
Show file tree
Hide file tree
Showing 43 changed files with 2,249 additions and 1,024 deletions.
2 changes: 2 additions & 0 deletions .circleci/build_cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Change the following version number to trigger a complete rebuild of the doc in CircleCI.
v4
24 changes: 17 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ version: 2.1

jobs:
build_docs:
docker:
- image: circleci/python:3.8.1-buster
machine:
image: ubuntu-2004:current
resource_class: large
steps:
- checkout

Expand All @@ -14,7 +15,7 @@ jobs:
sudo apt-get install wget
wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh;
chmod +x ~/miniconda.sh;
~/miniconda.sh -b -p ~/miniconda;
bash ~/miniconda.sh -b -p ~/miniconda;
- run:
name: Install openmpi
Expand All @@ -36,7 +37,7 @@ jobs:
command: |
source ~/miniconda/bin/activate testenv
sudo apt-get install pandoc
pip install sphinx numpydoc sphinx_bootstrap_theme pillow nbsphinx
pip install sphinx numpydoc sphinx_bootstrap_theme sphinx-copybutton pillow nbsphinx
pip install --user -U https://api.github.com/repos/sphinx-gallery/sphinx-gallery/zipball/master
- run:
Expand All @@ -50,8 +51,11 @@ jobs:
command: |
source ~/miniconda/bin/activate testenv
pip install -U pip setuptools virtualenv
pip install ipywidgets voila
python setup.py install
pip install '.[gui]'
- restore_cache:
keys:
- built-{{ checksum ".circleci/build_cache" }}

- run:
name: Build the documentation
Expand All @@ -63,6 +67,12 @@ jobs:
root: doc/_build
paths: html

- save_cache:
key: built-{{ checksum ".circleci/build_cache" }}
paths:
- doc/auto_examples
- doc/_build

- store_artifacts:
path: doc/_build/html/
destination: html
Expand Down Expand Up @@ -103,4 +113,4 @@ workflows:
- build_docs
filters:
branches:
only: master
only: master
5 changes: 2 additions & 3 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ jobs:
sudo apt-get install pandoc
python -m pip install --upgrade pip
pip install numpy matplotlib scipy NEURON
pip install ipywidgets voila
pip install sphinx-gallery sphinx sphinx_bootstrap_theme numpydoc pillow nbsphinx
python setup.py install
pip install sphinx-gallery sphinx sphinx_bootstrap_theme sphinx-copybutton numpydoc pillow nbsphinx
pip install '.[gui]'
- name: Linkcheck
shell: bash -el {0}
run: |
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
pip install mne psutil joblib
pip install NEURON
pip install ipywidgets voila
pip install psutil joblib
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
pip install mpi4py
else
Expand All @@ -45,15 +43,15 @@ jobs:
- name: Install HNN-core
shell: bash -el {0}
run: |
python setup.py --verbose install
pip install --verbose '.[gui]'
- name: Lint with flake8
shell: bash -el {0}
run: |
flake8 --count hnn_core
- name: Test with pytest
shell: bash -el {0}
run: |
python -m py.test . --cov=hnn_core hnn_core/tests/ --cov-report=xml
python -m pytest . --cov=hnn_core hnn_core/tests/ --cov-report=xml
- name: Upload code coverage
shell: bash -el {0}
run: |
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/windows_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Unit test

on:
push:
branches: ['**']
pull_request:
branches: ['**']

env:
PYTHONPATH: C:\nrn_test\lib\python
NEURONHOME: C:\nrn_test

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
python-version: ${{ matrix.python-version }}
- name: Install Neuron on Windows separately
shell: cmd
run: |
powershell -command "gh release download --repo https://github.com/neuronsimulator/nrn --pattern '*.exe' --output nrn-setup.exe"
start /b /wait .\nrn-setup.exe /S /D=C:\nrn_test
powershell -command "'C:\nrn_test\bin' >> $env:GITHUB_PATH"
python -c "import neuron"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies and HNN
shell: cmd
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
pip install psutil joblib
pip install --verbose .[gui]
- name: Test with pytest
shell: cmd
run: |
python -m pytest . --cov=hnn_core hnn_core/tests/ --cov-report=xml
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ recursive-include examples *.py
recursive-include examples *.txt

recursive-include hnn_core/mod *
recursive-include hnn_core/mod/x86_64 *
recursive-include hnn_core/mod/x86_64/.libs *

recursive-include hnn_core *.py
recursive-include hnn_core *.ipynb
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ clean :

check-manifest:
check-manifest

test: flake
pytest .

flake:
@if command -v flake8 > /dev/null; then \
echo "Running flake8"; \
flake8 hnn_core --count; \
else \
echo "flake8 not found, please install it!"; \
exit 1; \
fi;
@echo "flake8 passed"
47 changes: 29 additions & 18 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ hnn-core

This is a leaner and cleaner version of the code based off the `HNN repository <https://github.com/jonescompneurolab/hnn>`_.

It is early Work in Progress. Contributors are very welcome.
Contributors are very welcome. Please read our
:doc:`contributing guide <contributing>` if you are interested.

Dependencies
------------
hnn-core requires Python (>=3.7) and the following packages:

* numpy
* scipy
Expand All @@ -23,8 +25,8 @@ Optional dependencies
GUI
~~~

* ipywidgets
* voila
* ipywidgets (<=7.7.1)
* voila (<=0.3.6)

Parallel processing
~~~~~~~~~~~~~~~~~~~
Expand All @@ -51,11 +53,11 @@ because the pip installer works better with virtual environments such as the one

If you want to track the latest developments of ``hnn-core``, you can install the current version of the code (nightly) with::

$ pip install --upgrade https://api.github.com/repos/jonescompneurolab/hnn-core/zipball/master
$ pip install --upgrade https://api.github.com/repos/jonescompneurolab/hnn-core/zipball/master

To check if everything worked fine, you can do::

$ python -c 'import hnn_core'
$ python -c 'import hnn_core'

and it should not give any error messages.

Expand All @@ -64,6 +66,10 @@ and it should not give any error messages.
To install the GUI dependencies along with ``hnn-core``, a simple tweak to the above command is needed::

$ pip install hnn_core[gui]
Note if you are zsh in macOS the command is::

$ pip install hnn_core'[gui]'

To start the GUI, please do::

Expand All @@ -76,17 +82,17 @@ than one CPU core, refer to our `parallel backend guide`_.

**Note for Windows users**

The pip installer for Neuron does not yet work for Windows. In this case, it is better to
install ``hnn_core`` without the dependencies::
Install Neuron using the `precompiled installers`_ **before** installing
``hnn-core``. Make sure that::

$ pip install hnn_core --no-deps
$ python -c 'import neuron;'

and then install the dependencies separately::
does not throw any errors before running the install command.
If you encounter errors, please get help from `NEURON forum`_.
Finally, do::

$ pip install scipy numpy matplotlib
$ pip install hnn_core[gui]

and install Neuron using the traditional package installer available here
`https://neuron.yale.edu/neuron/ <https://neuron.yale.edu/neuron/>`_.

Documentation and examples
==========================
Expand Down Expand Up @@ -117,10 +123,15 @@ report bugs. For user questions and scientific discussions, please join the
Interested in Contributing?
===========================

Read our `contributing guide`_.
Read our :doc:`contributing guide <contributing>`.

Roadmap
=======

Read our `roadmap`_.

.. _parallel backend guide: https://jonescompneurolab.github.io/hnn-core/dev/parallel.html
.. _contributing guide: https://jonescompneurolab.github.io/hnn-core/dev/contributing.html
.. _precompiled installers: https://www.neuron.yale.edu/neuron/download
.. _NEURON forum: https://www.neuron.yale.edu/phpbb/

.. |tests| image:: https://github.com/jonescompneurolab/hnn-core/actions/workflows/unit_tests.yml/badge.svg?branch=master
:target: https://github.com/jonescompneurolab/hnn-core/actions/?query=branch:master+event:push
Expand All @@ -129,12 +140,12 @@ Read our `contributing guide`_.
:target: https://circleci.com/gh/jonescompneurolab/hnn-core

.. |Codecov| image:: https://codecov.io/gh/jonescompneurolab/hnn-core/branch/master/graph/badge.svg
:target: https://codecov.io/gh/jonescompneurolab/hnn-core
:target: https://codecov.io/gh/jonescompneurolab/hnn-core

.. |PyPI| image:: https://img.shields.io/pypi/dm/hnn-core.svg?label=PyPI%20downloads
:target: https://pypi.org/project/hnn-core/
:target: https://pypi.org/project/hnn-core/

.. |HNN-GUI| image:: https://user-images.githubusercontent.com/11160442/178095018-35d2619a-6a82-4e27-91c9-ff2796fab435.png
.. |HNN-GUI| image:: https://user-images.githubusercontent.com/11160442/197026635-39b6564a-f529-4caf-870e-af9ca4d2fb75.png

.. |Gitter| image:: https://badges.gitter.im/jonescompneurolab/hnn_core.svg
:target: https://gitter.im/jonescompneurolab/hnn-core?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
2 changes: 1 addition & 1 deletion doc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN pip install numpy && \
pip install scipy && \
pip install matplotlib && \
pip install pyqt5 && \
pip install ipywidgets && \
pip install 'ipywidgets<=7.7.1' && \
pip install pillow && \
pip install https://api.github.com/repos/mne-tools/mne-python/zipball/master

Expand Down
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ clean:
rm -rf modules/*

html-noplot:
$(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
$(SPHINXBUILD) -D plot_gallery=0 -D nbsphinx_execute=never -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

Expand Down
9 changes: 5 additions & 4 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ Dipole (:py:mod:`hnn_core.dipole`):

ExtracellularArray (:py:mod:`hnn_core.extracellular`):
------------------------------------------------------

.. currentmodule:: hnn_core.extracellular

.. autosummary::
:toctree: generated/

ExtracellularArray

Visualization (:py:mod:`hnn_core.viz`):
Expand All @@ -80,6 +80,8 @@ Visualization (:py:mod:`hnn_core.viz`):
plot_tfr_morlet
plot_cell_connectivity
plot_connectivity_matrix
plot_laminar_lfp
plot_laminar_csd

Parallel backends (:py:mod:`hnn_core.parallel_backends`):
---------------------------------------------------------
Expand Down Expand Up @@ -113,4 +115,3 @@ GUI (:py:mod:`hnn_core.gui`):
:toctree: generated/

HNNGUI

Loading

0 comments on commit 1e05e11

Please sign in to comment.