"""Public package module.

Conceptually, this package groups the reusable helpers that support data
loading, signal processing, decoding, session-aware analysis, and figure
construction.

It exists as a separate package so notebooks and scripts can import focused
modules directly while compatibility facades preserve stable legacy entry
points.

It connects the package-level lazy module namespace to the concrete helper
modules listed in `__all__`.
"""

from __future__ import annotations

import importlib
from typing import Any

__all__ = [
    "behavior",
    "brain_plotting",
    "coding_direction",
    "core",
    "decoding",
    "decoding_pipelines",
    "dropout",
    "figure_brainmaps",
    "figure_coding_direction",
    "figure_decoding",
    "figure_data",
    "figure_opto_sessions",
    "figure_pca",
    "figure_psth",
    "figure_roc",
    "figure_stats",
    "figure_style",
    "figure_temporalcorr",
    "loading",
    "loading_base",
    "loading_nwb",
    "loading_processed",
    "math_utils",
    "movement",
    "paths",
    "pipelines",
    "psth_build",
    "selection",
    "session_aware",
    "session_context",
    "session_io",
    "session_trials",
    "signal_utils",
    "stats_utils",
    "subspace",
    "svm",
]


def __getattr__(name: str) -> Any:
    if name in __all__:
        module = importlib.import_module(f".{name}", __name__)
        globals()[name] = module
        return module
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")


def __dir__() -> list[str]:
    return sorted(list(globals().keys()) + __all__)
