Skip to content

Commit

Permalink
[MAINT] Make package pip-installable (#61)
Browse files Browse the repository at this point in the history
* [MAINT] Make package pip-installable

* cleanup + pep

* bump version to 0.1.3

* Update README.md

* Update conf.py
  • Loading branch information
nbara committed Nov 14, 2022
1 parent 70f1294 commit 154cfc5
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include README.md
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
2 changes: 1 addition & 1 deletion meegkit/__init__.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions meegkit/sns.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
----------
Expand Down Expand Up @@ -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.
"""
Expand Down
2 changes: 1 addition & 1 deletion meegkit/utils/asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ matplotlib
scikit-learn
pandas
joblib
flake8
pytest
pytest-cov
codecov
codespell
pydocstyle
tqdm
statsmodels
pyriemann>=0.2.7
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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]

20 changes: 17 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,27 @@
#
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='[email protected]',
license='UNLICENSED',
version='0.1.2',
license='BSD (3-clause)',
version='0.1.3',
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", "statsmodels"],
zip_safe=False)

0 comments on commit 154cfc5

Please sign in to comment.