Skip to content

Commit

Permalink
MAINT: drop io namespace
Browse files Browse the repository at this point in the history
io is builtin to the package name, as io is clearly the scope of this package. thus I dont think we need the io sub module namespace. The directory structure was kind of like a box in a box with the io namespace.
  • Loading branch information
scott-huberty committed Apr 2, 2024
1 parent ea2a2e7 commit 964e73c
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ for class names.
Reading EDF files
-----------------

.. automodule:: eyelinkio.io.edf.read_edf
.. automodule:: eyelinkio.edf.read_edf
:members:
:exclude-members: EDF


``EDF`` class
-------------

.. autoclass:: eyelinkio.io.EDF
.. autoclass:: eyelinkio.EDF
:members:
4 changes: 2 additions & 2 deletions eyelinkio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
#
# License: BSD (3-clause)

from . import io, utils
from . import utils

from .io import read_edf, EDF
from .edf import read_edf, EDF
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion eyelinkio/io/edf/read_edf.py → eyelinkio/edf/read_edf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
has_edfapi = False
why_not = str(exp)

from ...utils import to_mne, to_pandas
from . import _defines as defines
from ._defines import event_constants

Expand Down Expand Up @@ -104,6 +103,7 @@ def to_pandas(self):
A dictionary of :class:`~pandas.DataFrame`'s, containing the samples,
blinks, saccades, fixations, messages, and calibrations.
"""
from ..utils import to_pandas
return to_pandas(self)

def to_mne(self):
Expand All @@ -116,6 +116,7 @@ def to_mne(self):
calibrations : list of Calibration
A list of Calibration objects.
"""
from ..utils import to_mne
return to_mne(self)

class _edf_open:
Expand Down
1 change: 0 additions & 1 deletion eyelinkio/io/__init__.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import numpy as np
import pytest

from eyelinkio.io import read_edf
from eyelinkio.utils import _get_test_fnames
from eyelinkio.utils.check import requires_edfapi
from eyelinkio import read_edf
from eyelinkio.utils import _get_test_fnames, requires_edfapi

fnames = _get_test_fnames()

Expand Down
3 changes: 2 additions & 1 deletion eyelinkio/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from .utils import to_pandas, to_mne, _get_test_fnames
from .check import requires_edfapi
from .utils import to_pandas, to_mne, _get_test_fnames
2 changes: 1 addition & 1 deletion eyelinkio/utils/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def _has_edfapi():
"""Determine if a user has edfapi installed."""
from ..io.edf.read_edf import has_edfapi
from ..edf.read_edf import has_edfapi
return has_edfapi


Expand Down
4 changes: 2 additions & 2 deletions eyelinkio/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

import numpy as np

from ..io.edf import _defines
from ..edf import _defines
from .check import _check_mne_installed, _check_pandas_installed


def _get_test_fnames():
"""Get usable test files (omit EDF if no edf2asc)."""
path = Path(__file__).parent.parent / "io" / "tests" / "data"
path = Path(__file__).parent.parent / "tests" / "data"
fnames = sorted(list(path.glob("*.edf"))) # test_2.edf will be first
assert fnames[0].exists()
return fnames
Expand Down

0 comments on commit 964e73c

Please sign in to comment.