"""
DYF-RS - Density Yields Features (Rust Core)

This is the Rust-accelerated core for the dyf package.
Install the 'dyf' package for the full Python interface.

Example:
    >>> from dyf_rs import DensityClassifier
    >>> classifier = DensityClassifier(embedding_dim=384)
    >>> classifier.fit(embeddings)
    >>> print(classifier.report())
"""

from ._core import (
    PyDensityClassifier as DensityClassifier,
    PyDensityReport as DensityReport,
    PyBridgeAnalysis as BridgeAnalysis,
    PyBridgePersistence as BridgePersistence,
    PyMultiResolutionAnalysis as MultiResolutionAnalysis,
    # Louvain community detection
    py_louvain_communities as louvain_communities,
    py_louvain_from_centroids as louvain_from_centroids,
    py_build_knn_graph as build_knn_graph,
    # DYF2 file format
    PyDyfFile as DyfFile,
)

from importlib.metadata import version as _get_version
__version__ = _get_version("dyf-rs")
__all__ = [
    "DensityClassifier", "DensityReport", "BridgeAnalysis",
    "BridgePersistence", "MultiResolutionAnalysis",
    "louvain_communities", "louvain_from_centroids", "build_knn_graph",
    "DyfFile",
]

# GPU compute (optional — only available when built with --features gpu)
try:
    from ._core import (
        PyGpuContext as GpuContext,
        PyGpuTreeRouter as GpuTreeRouter,
        py_gpu_power_iteration as gpu_power_iteration,
        py_gpu_hash_batch as gpu_hash_batch,
    )
    __all__ += ["GpuContext", "GpuTreeRouter", "gpu_power_iteration", "gpu_hash_batch"]
except ImportError:
    pass
