From 3e6b55fc9fe6697517bcec7a1ffca4ae8deb7381 Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 14 Nov 2022 14:32:24 +0100 Subject: [PATCH 1/5] [MAINT] Make package pip-installable --- MANIFEST.in | 1 + setup.py | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..bb3ec5f0 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include README.md diff --git a/setup.py b/setup.py index 608ce40a..88068745 100644 --- a/setup.py +++ b/setup.py @@ -2,13 +2,42 @@ # from setuptools import setup, find_packages +with open("README.md", "r", encoding="utf8") as fid: + long_description = fid.read() + setup( name='meegkit', description='M/EEG denoising in Python', + long_description=long_description, + long_description_content_type="text/markdown", url='http://github.com/nbara/python-meegkit/', - author='N Barascud', + author='Nicolas Barascud', author_email='nicolas.barascud@gmail.com', - license='UNLICENSED', + license='BSD (3-clause)', version='0.1.2', packages=find_packages(exclude=['doc', 'tests']), + project_urls={ + "Documentation": "https://nbara.github.io/python-meegkit/", + "Source": "https://github.com/nbara/python-meegkit/", + "Tracker": "https://github.com/nbara/python-meegkit/issues/", + }, + platforms="any", + python_requires=">=3.7", + install_requires=["numpy", "scipy", "scikit-learn", "joblib", "pandas", + "matplotlib", "tqdm", "pyriemann"], + extras_require={ + "docs": [ + "sphinx", + "sphinx-gallery", + "sphinx-bootstrap_theme", + "sphinx-copybutton", + "sphinxemoji", + "numpydoc", + "pydata-sphinx-theme", + "pillow", + "jupyter-sphinx", + ], + "tests": ["pytest", "pytest-cov", "codecov", "codespell", "flake8", + "pydocstyle"], + }, zip_safe=False) From c91639db0641af36dff9d1587ed9eb63cff59db7 Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 14 Nov 2022 14:57:40 +0100 Subject: [PATCH 2/5] cleanup + pep --- .github/workflows/pythonpackage.yml | 2 +- .travis.yml | 2 +- meegkit/sns.py | 6 +++--- meegkit/utils/asr.py | 2 +- requirements.txt | 6 ------ setup.cfg | 2 ++ setup.py | 17 +---------------- 7 files changed, 9 insertions(+), 28 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 7499ebab..8e4c8ff0 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -26,7 +26,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install -e ".[extra]" + pip install -e ".[tests]" - name: Lint with flake8 run: | make pep diff --git a/.travis.yml b/.travis.yml index efdbd043..220363e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ python: install: - sudo apt-get update - pip install -r requirements.txt - - pip install -e ".[extra]" + - pip install -e ".[docs]" script: - mkdir docs - cd doc diff --git a/meegkit/sns.py b/meegkit/sns.py index cb23b2ee..9ad0fe38 100644 --- a/meegkit/sns.py +++ b/meegkit/sns.py @@ -7,7 +7,7 @@ def sns(X, n_neighbors=0, skip=0, weights=np.array([])): - """Sensor Noise Suppresion. + """Sensor Noise Suppression. This algorithm will replace the data from each channel by its regression on the subspace formed by the other channels. The underlying assumptions are @@ -62,7 +62,7 @@ def sns(X, n_neighbors=0, skip=0, weights=np.array([])): def sns0(c, n_neighbors=0, skip=0, wc=np.array([])): - """Sensor Noise Suppresion from data covariance. + """Sensor Noise Suppression from data covariance. Parameters ---------- @@ -130,7 +130,7 @@ def sns0(c, n_neighbors=0, skip=0, wc=np.array([])): def sns1(X, n_neighbors=None, skip=0): - """Sensor Noise Suppresion 1. + """Sensor Noise Suppression 1. This version of SNS first regresses out major shared components. """ diff --git a/meegkit/utils/asr.py b/meegkit/utils/asr.py index 9018e9eb..3a15120d 100755 --- a/meegkit/utils/asr.py +++ b/meegkit/utils/asr.py @@ -412,7 +412,7 @@ def polystab(a): b = a[ind[0][0]] * np.poly(v) # Return only real coefficients if input was real: - if not(np.sum(np.imag(a))): + if not np.sum(np.imag(a)): b = np.real(b) return b diff --git a/requirements.txt b/requirements.txt index 29ca0982..6f4d7416 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,12 +4,6 @@ matplotlib scikit-learn pandas joblib -flake8 -pytest -pytest-cov -codecov -codespell -pydocstyle tqdm statsmodels pyriemann>=0.2.7 diff --git a/setup.cfg b/setup.cfg index 33cb9db7..ea9b3246 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,4 +20,6 @@ upload-dir = doc/_build/html [options.extras_require] extra = pymanopt +docs = sphinx;sphinx-gallery;sphinx-bootstrap_theme;sphinx-copybutton;sphinxemoji;numpydoc;pydata-sphinx-theme;pillow;jupyter-sphinx;meegkit[extra] +tests = pytest;pytest-cov;codecov;codespell;flake8;pydocstyle;meegkit[extra] diff --git a/setup.py b/setup.py index 88068745..7726509f 100644 --- a/setup.py +++ b/setup.py @@ -24,20 +24,5 @@ platforms="any", python_requires=">=3.7", install_requires=["numpy", "scipy", "scikit-learn", "joblib", "pandas", - "matplotlib", "tqdm", "pyriemann"], - extras_require={ - "docs": [ - "sphinx", - "sphinx-gallery", - "sphinx-bootstrap_theme", - "sphinx-copybutton", - "sphinxemoji", - "numpydoc", - "pydata-sphinx-theme", - "pillow", - "jupyter-sphinx", - ], - "tests": ["pytest", "pytest-cov", "codecov", "codespell", "flake8", - "pydocstyle"], - }, + "matplotlib", "tqdm", "pyriemann", "statsmodels"], zip_safe=False) From 81436e03b51bddb3fe02067c552bba507961b819 Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 14 Nov 2022 15:34:58 +0100 Subject: [PATCH 3/5] bump version to 0.1.3 --- meegkit/__init__.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meegkit/__init__.py b/meegkit/__init__.py index e01b7aba..9205cfb4 100644 --- a/meegkit/__init__.py +++ b/meegkit/__init__.py @@ -1,5 +1,5 @@ """M/EEG denoising utilities in python.""" -__version__ = '0.1.2' +__version__ = '0.1.3' from . import asr, cca, detrend, dss, sns, star, ress, trca, tspca, utils diff --git a/setup.py b/setup.py index 7726509f..d6e32cbe 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ author='Nicolas Barascud', author_email='nicolas.barascud@gmail.com', license='BSD (3-clause)', - version='0.1.2', + version='0.1.3', packages=find_packages(exclude=['doc', 'tests']), project_urls={ "Documentation": "https://nbara.github.io/python-meegkit/", From 484992a06169617623cf3038de24b12f256d6cf9 Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 14 Nov 2022 15:39:46 +0100 Subject: [PATCH 4/5] Update README.md --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 953d4d60..d47052b2 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,11 @@ [![twitter](https://img.shields.io/twitter/follow/lebababa?label=Twitter&style=flat&logo=Twitter)](https://twitter.com/intent/follow?screen_name=lebababa) # MEEGkit + Denoising tools for M/EEG processing in Python 3.7+. ![meegkit-ERP](https://user-images.githubusercontent.com/10333715/176754293-eaa35071-94f8-40dd-a487-9f8103c92571.png) - > **Disclaimer:** The project mostly consists of development code, although some modules and functions are already working. Bugs and performance problems are to be expected, so use at your own risk. More tests and improvements will be added in the future. Comments and suggestions are welcome. ## Documentation @@ -21,10 +21,10 @@ This code can also be tested directly from your browser using [Binder](https://m ## Installation -This package can be installed easily using `pip+git`: +This package can be installed easily using `pip`: ```bash -pip install git+https://github.com/nbara/python-meegkit.git +pip install meegkit ``` Or you can clone this repository and run the following commands inside the `python-meegkit` directory: @@ -47,9 +47,11 @@ pip install -e '.[extra]' or: ```bash -pip install git+https://github.com/nbara/python-meegkit.git#egg=meegkit[extra] +pip install meegkit[extra] ``` +Other available options are `[docs]` (which installs dependencies required to build the documentation), or `[tests]` (which install dependencies to run unit tests). + ## References ### 1. CCA, STAR, SNS, DSS, ZapLine, and robust detrending From 8ecc473d79d87c9fb256e90b1d2b6e5490557638 Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 14 Nov 2022 15:45:56 +0100 Subject: [PATCH 5/5] Update conf.py --- doc/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index ada6ab3c..e7d4314c 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -23,8 +23,8 @@ # -- Project information ----------------------------------------------------- -project = f'MEEGkit v{meegkit.__version__}' -copyright = '2021, Nicolas Barascud' +project = 'MEEGkit' +copyright = '2022, Nicolas Barascud' author = 'Nicolas Barascud' release = meegkit.__version__ version = meegkit.__version__