Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] update to Python>=3.8 #678

Merged
merged 7 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ 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
pip install mne pooch tqdm psutil mpi4py joblib nibabel

- run:
name: Setup doc building stuff
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this was changed because the mpi4py installation was failing for Ubuntu/Python 3.9. Not totally sure what the root of the issue was.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming the default repository identified for the conda install had an old/incompatible version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like that. We technically shouldn't need to install the openmpi python library on Linux if it's already installed at the system level, but now we can just rely on wheels that are compiled and tested by the maintainers of mpi4py.

- name: Install HNN-core
shell: bash -el {0}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions examples/workflows/plot_simulate_somato.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions hnn_core/tests/test_viz.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading