"""
pyiwfm - Python package for IWFM (Integrated Water Flow Model) models.

This package provides tools for:
- Reading and writing IWFM model files
- Visualizing model meshes and results
- Comparing different model versions
- Generating finite element meshes
"""

from __future__ import annotations

from importlib.metadata import version as _pkg_version

__version__: str = _pkg_version("pyiwfm")

from pyiwfm.components.groundwater import AppGW
from pyiwfm.components.lake import AppLake
from pyiwfm.components.rootzone import RootZone
from pyiwfm.components.small_watershed import AppSmallWatershed
from pyiwfm.components.stream import AppStream
from pyiwfm.components.unsaturated_zone import AppUnsatZone
from pyiwfm.core.base_component import BaseComponent
from pyiwfm.core.exceptions import (
    IWFMIOError,
    MeshError,
    PyIWFMError,
    StratigraphyError,
    ValidationError,
)
from pyiwfm.core.mesh import AppGrid, Element, Face, Node, Subregion
from pyiwfm.core.model import IWFMModel
from pyiwfm.core.stratigraphy import Stratigraphy

# Runner module for executing IWFM via subprocess
from pyiwfm.runner import (
    BudgetResult,
    InstructionFile,
    IWFMExecutables,
    IWFMRunner,
    ObservationGroup,
    PESTInterface,
    PreprocessorResult,
    RunResult,
    Scenario,
    ScenarioManager,
    ScenarioResult,
    SimulationResult,
    TemplateFile,
    ZBudgetResult,
    find_iwfm_executables,
)
from pyiwfm.sample_models import (
    create_sample_budget_data,
    create_sample_element_field,
    create_sample_mesh,
    create_sample_model,
    create_sample_scalar_field,
    create_sample_stratigraphy,
    create_sample_stream_network,
    create_sample_timeseries,
    create_sample_timeseries_collection,
    create_sample_triangular_mesh,
)

__all__ = [
    "__version__",
    # Core mesh classes
    "Node",
    "Element",
    "Face",
    "Subregion",
    "AppGrid",
    # Stratigraphy
    "Stratigraphy",
    # Model
    "IWFMModel",
    # Components
    "BaseComponent",
    "AppGW",
    "AppStream",
    "AppLake",
    "RootZone",
    "AppSmallWatershed",
    "AppUnsatZone",
    # Exceptions
    "PyIWFMError",
    "MeshError",
    "StratigraphyError",
    "ValidationError",
    "IWFMIOError",
    # Sample models
    "create_sample_mesh",
    "create_sample_triangular_mesh",
    "create_sample_stratigraphy",
    "create_sample_scalar_field",
    "create_sample_element_field",
    "create_sample_timeseries",
    "create_sample_timeseries_collection",
    "create_sample_stream_network",
    "create_sample_budget_data",
    "create_sample_model",
    # Runner module
    "IWFMRunner",
    "IWFMExecutables",
    "find_iwfm_executables",
    "RunResult",
    "PreprocessorResult",
    "SimulationResult",
    "BudgetResult",
    "ZBudgetResult",
    "Scenario",
    "ScenarioManager",
    "ScenarioResult",
    "PESTInterface",
    "TemplateFile",
    "InstructionFile",
    "ObservationGroup",
]
