From e7167c949951d1336bc8750d7acd57fbd421f50e Mon Sep 17 00:00:00 2001 From: Ryan Thorpe Date: Tue, 26 Sep 2023 14:10:40 -0400 Subject: [PATCH 1/7] use python>=3.7 in config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index afdeb4c85..097e346b5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,7 +27,7 @@ jobs: command: | export PATH=~/miniconda/bin:$PATH conda update --yes --quiet conda - conda create -n testenv --yes pip python=3.7 + conda create -n testenv --yes pip python=3.8 source activate testenv conda install --yes scipy numpy matplotlib pip install mne pooch tqdm psutil mpi4py joblib From d0d8981933768d6f60763c3f857fed2f0b144eed Mon Sep 17 00:00:00 2001 From: Ryan Thorpe Date: Tue, 26 Sep 2023 14:35:11 -0400 Subject: [PATCH 2/7] only support python>=3.8, including tests --- .github/workflows/unit_tests.yml | 2 +- .github/workflows/windows_unit_tests.yml | 2 +- README.rst | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 790220b56..288acdbd4 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - python-version: [3.7, 3.8] + python-version: [3.8, 3.9] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/windows_unit_tests.yml b/.github/workflows/windows_unit_tests.yml index bde71c534..0bdeb37fd 100644 --- a/.github/workflows/windows_unit_tests.yml +++ b/.github/workflows/windows_unit_tests.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [windows-latest] - python-version: [3.7, 3.8] + python-version: [3.8, 3.9] steps: - uses: actions/checkout@v2 diff --git a/README.rst b/README.rst index 86a622336..071866f28 100644 --- a/README.rst +++ b/README.rst @@ -44,7 +44,7 @@ Contributors are very welcome. Please read our Dependencies ------------ -hnn-core requires Python (>=3.7) and the following packages: +hnn-core requires Python (>=3.8) and the following packages: * numpy * scipy diff --git a/setup.py b/setup.py index b2c367d47..c116695fb 100644 --- a/setup.py +++ b/setup.py @@ -109,7 +109,7 @@ def run(self): 'gui': ['ipywidgets <=7.7.1', 'ipympl<0.9', 'voila<=0.3.6'], 'opt': ['scikit-learn'] }, - python_requires='>=3.7', + python_requires='>=3.8', packages=find_packages(), package_data={'hnn_core': [ 'param/*.json', From be1fa2793e38dc7a348d68d362750a5fd28e2baf Mon Sep 17 00:00:00 2001 From: Ryan Thorpe Date: Tue, 26 Sep 2023 14:49:16 -0400 Subject: [PATCH 3/7] remove system openmpi installation for ubuntu build --- .github/workflows/unit_tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 288acdbd4..170c9e16a 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -27,7 +27,6 @@ jobs: if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update - sudo apt-get install libopenmpi-dev openmpi-bin fi; - name: Install dependencies shell: bash -el {0} From ee26f51d16fb5fdca9a283de5ca937c4e17e6c10 Mon Sep 17 00:00:00 2001 From: Ryan Thorpe Date: Tue, 26 Sep 2023 14:59:47 -0400 Subject: [PATCH 4/7] install mpi4py and openmpi with conda-forge for ubuntu build --- .github/workflows/unit_tests.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 170c9e16a..26572131a 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -27,6 +27,7 @@ jobs: if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update + sudo apt-get install libopenmpi-dev openmpi-bin fi; - name: Install dependencies shell: bash -el {0} @@ -34,11 +35,7 @@ jobs: python -m pip install --upgrade pip pip install flake8 pytest pytest-cov pip install psutil joblib - if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then - pip install mpi4py - else - conda install --yes mpi4py openmpi - fi + conda install --yes -c conda-forge mpi4py openmpi - name: Install HNN-core shell: bash -el {0} run: | From ff695fcaa98b7a1d8cc673a6867dd4a5c22f3b63 Mon Sep 17 00:00:00 2001 From: rythorpe Date: Mon, 2 Oct 2023 23:59:04 -0400 Subject: [PATCH 5/7] update _fake_click() in test_viz.py --- hnn_core/tests/test_viz.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hnn_core/tests/test_viz.py b/hnn_core/tests/test_viz.py index b362a78f9..c3553fe19 100644 --- a/hnn_core/tests/test_viz.py +++ b/hnn_core/tests/test_viz.py @@ -1,7 +1,7 @@ -from functools import partial import os.path as op import matplotlib +from matplotlib import backend_bases import matplotlib.pyplot as plt import numpy as np from numpy.testing import assert_allclose @@ -19,8 +19,11 @@ def _fake_click(fig, ax, point, button=1): """Fake a click at a point within axes.""" x, y = ax.transData.transform_point(point) - func = partial(fig.canvas.button_press_event, x=x, y=y, button=button) - func(guiEvent=None) + button_press_event = backend_bases.MouseEvent( + name='button_press_event', canvas=fig.canvas, + x=x, y=y, button=button + ) + fig.canvas.callbacks.process('button_press_event', button_press_event) def test_network_visualization(): From a401ce5db763c7769a3ac15f84f48f3ef11eed3a Mon Sep 17 00:00:00 2001 From: rythorpe Date: Tue, 3 Oct 2023 00:12:05 -0400 Subject: [PATCH 6/7] whats_new.rst --- doc/whats_new.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 3c3082a46..2567c3005 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -18,6 +18,9 @@ Changelog - Add ability to manually define colors in spike histogram plots, by `Nick Tolley`_ in :gh:`640` +- Update minimum supported version of Python to 3.8, by `Ryan Thorpe`_ in + :gh:`678`. + Bug ~~~ - Fix inconsistent connection mapping from drive gids to cell gids, by From 9205e617d5dd6a32157d3a169187a65bf5f98478 Mon Sep 17 00:00:00 2001 From: Nicholas Tolley Date: Tue, 3 Oct 2023 11:10:09 -0400 Subject: [PATCH 7/7] Add nibabel to circleCI install --- .circleci/config.yml | 2 +- examples/workflows/plot_simulate_somato.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 097e346b5..b57e4595d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,7 +30,7 @@ jobs: conda create -n testenv --yes pip python=3.8 source activate testenv conda install --yes scipy numpy matplotlib - pip install mne pooch tqdm psutil mpi4py joblib + pip install mne pooch tqdm psutil mpi4py joblib nibabel - run: name: Setup doc building stuff diff --git a/examples/workflows/plot_simulate_somato.py b/examples/workflows/plot_simulate_somato.py index d9cdb86c7..14141bfaa 100644 --- a/examples/workflows/plot_simulate_somato.py +++ b/examples/workflows/plot_simulate_somato.py @@ -22,8 +22,9 @@ ############################################################################### # First, we will import the packages needed for computing the inverse solution -# from the MNE somatosensory dataset. `MNE`_ can be installed with -# ``pip install mne``, and the somatosensory dataset can be downloaded by +# from the MNE somatosensory dataset. `MNE`_ (and its dependency `NiBabel`_) +# can be installed with ``pip install mne nibabel`` +# The somatosensory dataset can be downloaded by # importing ``somato`` from ``mne.datasets``. import os.path as op import matplotlib.pyplot as plt @@ -271,6 +272,7 @@ # .. LINKS # # .. _MNE: https://mne.tools/ +# .. _NiBabel: https://nipy.org/nibabel/ # .. _HNN ERP tutorial: https://jonescompneurolab.github.io/hnn-tutorials/erp/erp # .. _this MNE-python example: https://mne.tools/stable/auto_examples/inverse/plot_label_source_activations.html # .. |mne_label_fig| image:: https://user-images.githubusercontent.com/20212206/106524603-cfe75c80-64b0-11eb-9607-3415195c3e7a.png