diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3de86a0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,144 @@ +# PyCharm +.idea +.pytest_cache + +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + diff --git a/README.md b/README.md index 5926679..c33858f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# PyEEGLAB +# eeglabio -Python support for EEGLAB files \ No newline at end of file +Python I/O support for EEGLAB files \ No newline at end of file diff --git a/pyeeglab/__init__.py b/eeglabio/__init__.py similarity index 100% rename from pyeeglab/__init__.py rename to eeglabio/__init__.py diff --git a/pyeeglab/_version.py b/eeglabio/_version.py similarity index 100% rename from pyeeglab/_version.py rename to eeglabio/_version.py diff --git a/pyeeglab/epochs.py b/eeglabio/epochs.py similarity index 100% rename from pyeeglab/epochs.py rename to eeglabio/epochs.py diff --git a/pyeeglab/raw.py b/eeglabio/raw.py similarity index 100% rename from pyeeglab/raw.py rename to eeglabio/raw.py diff --git a/pyeeglab/tests/__init__.py b/eeglabio/tests/__init__.py similarity index 100% rename from pyeeglab/tests/__init__.py rename to eeglabio/tests/__init__.py diff --git a/pyeeglab/tests/data/test-eve.fif b/eeglabio/tests/data/test-eve.fif similarity index 100% rename from pyeeglab/tests/data/test-eve.fif rename to eeglabio/tests/data/test-eve.fif diff --git a/pyeeglab/tests/data/test_raw.fif b/eeglabio/tests/data/test_raw.fif similarity index 100% rename from pyeeglab/tests/data/test_raw.fif rename to eeglabio/tests/data/test_raw.fif diff --git a/pyeeglab/tests/test_epochs.py b/eeglabio/tests/test_epochs.py similarity index 95% rename from pyeeglab/tests/test_epochs.py rename to eeglabio/tests/test_epochs.py index 350939f..fa8aa6c 100644 --- a/pyeeglab/tests/test_epochs.py +++ b/eeglabio/tests/test_epochs.py @@ -11,6 +11,7 @@ event_name = Path(__file__).parent / "data" / 'test-eve.fif' +@pytest.mark.skip def _get_data(preload=False): """Get data.""" raw = read_raw_fif(raw_fname, preload=preload, verbose='warning') @@ -27,7 +28,7 @@ def test_export_set(tmpdir, preload): raw, events = _get_data()[:2] raw.load_data() epochs = Epochs(raw, events, preload=preload) - temp_fname = op.join(str(tmpdir), 'test.set') + temp_fname = op.join(str(tmpdir), 'test_epochs.set') export_set(epochs, temp_fname) epochs_read = read_epochs_eeglab(temp_fname) assert epochs.ch_names == epochs_read.ch_names diff --git a/pyeeglab/tests/test_raw.py b/eeglabio/tests/test_raw.py similarity index 80% rename from pyeeglab/tests/test_raw.py rename to eeglabio/tests/test_raw.py index 7d596d9..0c7f184 100644 --- a/pyeeglab/tests/test_raw.py +++ b/eeglabio/tests/test_raw.py @@ -6,14 +6,14 @@ from raw import export_set from utils_tests import _TempDir +raw_fname = Path(__file__).parent / "data" / "test_raw.fif" -def test_export_set(): + +def test_export_set(tmpdir): """Test saving a Raw instance to EEGLAB's set format""" - fname = Path(__file__).parent / "data" / "test_raw.fif" - raw = read_raw_fif(fname) + raw = read_raw_fif(raw_fname) raw.load_data() - tmpdir = _TempDir() - temp_fname = op.join(str(tmpdir), 'test.set') + temp_fname = op.join(str(tmpdir), 'test_raw.set') export_set(raw, temp_fname) raw_read = read_raw_eeglab(temp_fname, preload=True) assert raw.ch_names == raw_read.ch_names diff --git a/pyeeglab/utils.py b/eeglabio/utils.py similarity index 100% rename from pyeeglab/utils.py rename to eeglabio/utils.py diff --git a/pyeeglab/utils_tests.py b/eeglabio/utils_tests.py similarity index 100% rename from pyeeglab/utils_tests.py rename to eeglabio/utils_tests.py diff --git a/setup.py b/setup.py index 3b3079e..7cb13b9 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ long_description = fh.read() version = None -with open(os.path.join('pyeeglab', '_version.py'), 'r') as fid: +with open(os.path.join('eeglabio', '_version.py'), 'r') as fid: for line in (line.strip() for line in fid): if line.startswith('__version__'): version = line.split('=')[1].strip().strip("'") @@ -17,11 +17,11 @@ requires = f.read().splitlines() setuptools.setup( - name="pyeeglab", + name="eeglabio", version=version, author="Jack Zhang", author_email="zhangmengyu10@gmail.com", - description="Python support for EEGLAB files", + description="Python I/O support for EEGLAB files", license="BSD (3-clause)", long_description=long_description, long_description_content_type="text/markdown", @@ -35,7 +35,7 @@ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", ], - packages=setuptools.find_packages(), + packages=setuptools.find_packages(exclude=("*tests",)), python_requires=">=3.6", include_package_data=True, install_requires=requires,