Skip to content

Commit

Permalink
fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mscheltienne committed Mar 21, 2024
1 parent 0b4343d commit 55d8e22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pycrostates/cluster/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
to segment."""

from . import utils # noqa: F401
from .aahc import AAHCluster # noqa: F401
from .aahc import AAHCluster
from .array import ClusterArray
from .kmeans import ModKMeans # noqa: F401
from .kmeans import ModKMeans

__all__: tuple[str, ...] = ("ModKMeans", "AAHCluster", "ClusterArray")
7 changes: 5 additions & 2 deletions pycrostates/cluster/array.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from __future__ import annotations # c.f. PEP 563, PEP 649

from pathlib import Path
from typing import TYPE_CHECKING
from warnings import warn

import numpy as np
from mne import Info

from ..io import ChInfo
from ..utils._checks import _check_type
from ..utils._docs import copy_doc
from ._base import _BaseCluster
Expand All @@ -26,6 +27,8 @@ def __init__(
labels: Optional[NDArray[int]] = None,
ignore_polarity: bool = True,
) -> None:
from ..io import ChInfo

if not ignore_polarity:
raise NotImplementedError(
"pycrostates does not yet support 'ignore_polarity=False'."
Expand All @@ -51,7 +54,7 @@ def __init__(
if len(info["ch_names"]) != data.shape[1]:
raise ValueError(
f"The number of channels in 'data' ({data.shape[1]}) must match the "
f"number of channels in 'info' ({len(info["ch_names"])})."
f"number of channels in 'info' ({len(info['ch_names'])})."
)
self._n_clusters = data.shape[0]
self._info = ChInfo(info=info) # no-op if a ChInfo is priovided
Expand Down

0 comments on commit 55d8e22

Please sign in to comment.