From cf74401a2ff3326fa55f3d63e999c1edbd9bb2d8 Mon Sep 17 00:00:00 2001 From: Adam Li Date: Tue, 1 Mar 2022 10:49:10 -1000 Subject: [PATCH] release 0.3 (#86) * Adding release 0.3 * Fixing unit tests * Try fix intersphinx * Update mne_connectivity/tests/test_connectivity.py --- Makefile | 2 +- doc/conf.py | 2 +- doc/install.rst | 2 +- doc/whats_new.rst | 22 ++++----------- doc/whats_new_previous_releases.rst | 42 +++++++++++++++++++++++++++++ mne_connectivity/__init__.py | 2 +- mne_connectivity/io.py | 4 +-- 7 files changed, 53 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 2a91ae90..065c9dc9 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # caution: testing won't work on windows, see README PYTHON ?= python -PYTESTS ?= py.test +PYTESTS ?= pytest CTAGS ?= ctags CODESPELL_SKIPS ?= "*.fif,*.eve,*.gz,*.tgz,*.zip,*.mat,*.stc,*.label,*.w,*.bz2,*.annot,*.sulc,*.log,*.local-copy,*.orig_avg,*.inflated_avg,*.gii,*.pyc,*.doctree,*.pickle,*.inv,*.png,*.edf,*.touch,*.thickness,*.nofix,*.volume,*.defect_borders,*.mgh,lh.*,rh.*,COR-*,FreeSurferColorLUT.txt,*.examples,.xdebug_mris_calc,bad.segments,BadChannels,*.hist,empty_file,*.orig,*.js,*.map,*.ipynb,searchindex.dat,plot_*.rst,*.rst.txt,*.html,gdf_encodes.txt" CODESPELL_DIRS ?= mne_connectivity/ doc/ examples/ diff --git a/doc/conf.py b/doc/conf.py index 0c01d275..9fef7387 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -220,7 +220,7 @@ 'mne-bids': ('https://mne.tools/mne-bids/dev/', None), 'numpy': ('https://numpy.org/devdocs', None), 'scipy': ('https://scipy.github.io/devdocs', None), - 'matplotlib': ('https://matplotlib.org', None), + 'matplotlib': ('https://matplotlib.org/stable', None), 'pandas': ('https://pandas.pydata.org/pandas-docs/dev', None), 'sklearn': ('https://scikit-learn.org/stable', None), 'pyvista': ('https://docs.pyvista.org', None), diff --git a/doc/install.rst b/doc/install.rst index b5e52d86..af547e87 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -48,7 +48,7 @@ If you want to install a snapshot of the current development version, run: .. code-block:: bash - pip install --user -U https://api.github.com/repos/mne-tools/mne-connectivity/zipball/master + pip install --user -U https://api.github.com/repos/mne-tools/mne-connectivity/zipball/main To check if everything worked fine, the following command should not give any error messages: diff --git a/doc/whats_new.rst b/doc/whats_new.rst index e870a8f2..f6c51562 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -16,7 +16,7 @@ Here we list a changelog of MNE-connectivity. .. _current: -Version 0.3 (Unreleased) +Version 0.4 (Unreleased) ------------------------ ... @@ -24,34 +24,22 @@ Version 0.3 (Unreleased) Enhancements ~~~~~~~~~~~~ -- Adding symmetric orthogonalization via :func:`mne_connectivity.symmetric_orth`, by `Eric Larson`_ (:gh:`36`) -- Improved RAM usage for :func:`mne_connectivity.vector_auto_regression` by leveraging code from ``statsmodels``, by `Adam Li`_ (:gh:`46`) -- Added :func:`mne_connectivity.select_order` for helping to select VAR order using information criterion, by `Adam Li`_ (:gh:`46`) -- All connectivity functions retain ``events``, ``event_id`` and ``metadata`` from `mne.Epochs` objects as input and is stored as part of the connectivity object, by `Adam Li`_ (:gh:`58`) -- Add spectral connectivity over time function :func:`mne_connectivity.spectral_connectivity_time`, by `Adam Li`_ (:gh:`67`) -- Add conda installation, by `Adam Li`_ and `Richard Höchenberger`_ (:gh:`81`) +- Bug ~~~ -- Fixed bug when saving connectivity with ``n_jobs`` greater than 1 from :func:`mne_connectivity.spectral_connectivity_epochs`, by `Adam Li`_ (:gh:`43`) -- Fixed bug to allow saving complex data connectivity, by `Adam Li`_ (:gh:`43`) -- Fixed bug to keep label orientation upright in :func:`mne_connectivity.viz.plot_connectivity_circle`, by `Alexander Kroner`_ (:gh:`60`) +- API ~~~ -- Added ``h5netcdf`` as a requirement for saving connectivity data, by `Adam Li`_ (:gh:`43`) -- Changed keyword argument ``model_order`` in :func:`mne_connectivity.vector_auto_regression` to ``lags`` to more align with statsmodels API, by `Adam Li`_ (:gh:`47`) -- Add ``pandas`` as a requirement for dealing with metadata associated from the original Epochs file, by `Adam Li`_ (:gh:`58`) -- Rename ``mne_connectivity.spectral_connectivity`` to :func:`mne_connectivity.spectral_connectivity_epochs`, by `Adam Li`_ (:gh:`69`) +- Authors ~~~~~~~ -* `Adam Li`_ -* `Eric Larson`_ -* `Alexander Kroner`_ + :doc:`Find out what was new in previous releases ` diff --git a/doc/whats_new_previous_releases.rst b/doc/whats_new_previous_releases.rst index 8a73cdad..b5133aa9 100644 --- a/doc/whats_new_previous_releases.rst +++ b/doc/whats_new_previous_releases.rst @@ -7,6 +7,48 @@ What was new in previous releases? ================================== +Version 0.3 (2022-03-01) +------------------------ + +This version has bug fixes minor improvements in certain functions. A big change +is the renaming of functions ``spectral_connectivity`` to ``spectral_connectivity_epochs``, +which makes it explicit that the function operates over Epochs, rather then time. +Importantly, we also provide a conda installation now. + +Enhancements +~~~~~~~~~~~~ + +- Adding symmetric orthogonalization via :func:`mne_connectivity.symmetric_orth`, by `Eric Larson`_ (:gh:`36`) +- Improved RAM usage for :func:`mne_connectivity.vector_auto_regression` by leveraging code from ``statsmodels``, by `Adam Li`_ (:gh:`46`) +- Added :func:`mne_connectivity.select_order` for helping to select VAR order using information criterion, by `Adam Li`_ (:gh:`46`) +- All connectivity functions retain ``events``, ``event_id`` and ``metadata`` from `mne.Epochs` objects as input and is stored as part of the connectivity object, by `Adam Li`_ (:gh:`58`) +- Add spectral connectivity over time function :func:`mne_connectivity.spectral_connectivity_time`, by `Adam Li`_ (:gh:`67`) +- Add conda installation, by `Adam Li`_ and `Richard Höchenberger`_ (:gh:`81`) + +Bug +~~~ + +- Fixed bug when saving connectivity with ``n_jobs`` greater than 1 from :func:`mne_connectivity.spectral_connectivity_epochs`, by `Adam Li`_ (:gh:`43`) +- Fixed bug to allow saving complex data connectivity, by `Adam Li`_ (:gh:`43`) +- Fixed bug to keep label orientation upright in :func:`mne_connectivity.viz.plot_connectivity_circle`, by `Alexander Kroner`_ (:gh:`60`) + +API +~~~ + +- Added ``h5netcdf`` as a requirement for saving connectivity data, by `Adam Li`_ (:gh:`43`) +- Changed keyword argument ``model_order`` in :func:`mne_connectivity.vector_auto_regression` to ``lags`` to more align with statsmodels API, by `Adam Li`_ (:gh:`47`) +- Add ``pandas`` as a requirement for dealing with metadata associated from the original Epochs file, by `Adam Li`_ (:gh:`58`) +- Rename ``mne_connectivity.spectral_connectivity`` to :func:`mne_connectivity.spectral_connectivity_epochs`, by `Adam Li`_ (:gh:`69`) + +Authors +~~~~~~~ +People who contributed to this release (in alphabetical order): + +* `Adam Li`_ +* `Alexander Kroner`_ +* `Eric Larson`_ +* `Richard Höchenberger`_ + .. _changes_0_2: Version 0.2 (2021-09-07) diff --git a/mne_connectivity/__init__.py b/mne_connectivity/__init__.py index ff9cb82c..61ff76d0 100644 --- a/mne_connectivity/__init__.py +++ b/mne_connectivity/__init__.py @@ -6,7 +6,7 @@ # # License: BSD (3-clause) -__version__ = '0.3dev0' +__version__ = '0.3' from .base import (Connectivity, EpochConnectivity, EpochSpectralConnectivity, EpochSpectroTemporalConnectivity, EpochTemporalConnectivity, diff --git a/mne_connectivity/io.py b/mne_connectivity/io.py index 07486c89..270b56ac 100644 --- a/mne_connectivity/io.py +++ b/mne_connectivity/io.py @@ -44,8 +44,8 @@ def _xarray_to_conn(array, cls_func): metadata = _prepare_read_metadata(metadata) # write event IDs - event_id_keys = array.attrs.pop('event_id_keys') - event_id_vals = array.attrs.pop('event_id_vals') + event_id_keys = np.atleast_1d(array.attrs.pop('event_id_keys')).tolist() + event_id_vals = np.atleast_1d(array.attrs.pop('event_id_vals')).tolist() event_id = {key: val for key, val in zip(event_id_keys, event_id_vals)} array.attrs['event_id'] = event_id