"""SAX: S + Autograd + XLA."""

from __future__ import annotations

__author__ = "Floris Laporte"
__version__ = "0.16.4"

# isort: off
from .saxtypes import (
    AnyNetlist,
    ArrayLike,
    Backend,
    BackendLike,
    Bool,
    BoolArray,
    BoolArrayLike,
    BoolLike,
    CircuitInfo,
    Complex,
    ComplexArray,
    ComplexArray1D,
    ComplexArray1DLike,
    ComplexArrayLike,
    ComplexLike,
    Component,
    Connections,
    ExperimentalWarning,
    Float,
    FloatArray,
    FloatArray1D,
    FloatArray1DLike,
    FloatArray2D,
    FloatArray2DLike,
    FloatArrayLike,
    FloatLike,
    IOLike,
    Instance,
    InstanceName,
    InstancePort,
    Instances,
    Int,
    IntArray,
    IntArray1D,
    IntArray1DLike,
    IntArrayLike,
    IntLike,
    Mode,
    Model,
    ModelFactory,
    ModelFactoryMM,
    ModelFactorySM,
    ModelMM,
    ModelSM,
    Models,
    ModelsMM,
    ModelsSM,
    Name,
    Net,
    Netlist,
    Nets,
    Placement,
    Placements,
    Port,
    PortCombination,
    PortCombinationMM,
    PortCombinationSM,
    PortMap,
    PortMapMM,
    PortMapSM,
    PortMode,
    Ports,
    RecursiveNetlist,
    SCoo,
    SCooMM,
    SCooModel,
    SCooModelFactory,
    SCooModelFactoryMM,
    SCooModelFactorySM,
    SCooModelMM,
    SCooModelSM,
    SCooSM,
    SDense,
    SDenseMM,
    SDenseModel,
    SDenseModelFactory,
    SDenseModelFactoryMM,
    SDenseModelFactorySM,
    SDenseModelMM,
    SDenseModelSM,
    SDenseSM,
    SDict,
    SDictMM,
    SDictModel,
    SDictModelFactory,
    SDictModelFactoryMM,
    SDictModelFactorySM,
    SDictModelMM,
    SDictModelSM,
    SDictSM,
    SType,
    STypeMM,
    STypeSM,
    Settings,
    SettingsValue,
    default_placement,
    into,
    try_into,
)
from .constants import (
    C_M_S,
    C_UM_S,
    DEFAULT_MODE,
    DEFAULT_MODES,
    DEFAULT_WL_STEP,
    EPS,
    WL_C,
    WL_C_MAX,
    WL_C_MIN,
    WL_E,
    WL_E_MAX,
    WL_E_MIN,
    WL_L,
    WL_L_MAX,
    WL_L_MIN,
    WL_O,
    WL_O_MAX,
    WL_O_MIN,
    WL_S,
    WL_S_MAX,
    WL_S_MIN,
    wl_c,
    wl_e,
    wl_l,
    wl_o,
    wl_s,
)
from .loss import (
    huber_loss,
    l2_reg,
    mse,
)
from .s import (
    block_diag,
    get_mode,
    get_modes,
    get_port_combinations,
    get_ports,
    reciprocal,
    scoo,
    sdense,
    sdict,
)
from .utils import (
    Normalization,
    cartesian_product,
    clean_string,
    denormalize,
    flatten_dict,
    get_settings,
    grouped_interp,
    hash_dict,
    load_netlist,
    load_recursive_netlist,
    maybe,
    merge_dicts,
    normalization,
    normalize,
    read,
    rename_params,
    rename_ports,
    replace_kwargs,
    same_args_as,
    unflatten_dict,
    update_settings,
    wide_to_tidy,
)
from .multimode import (
    multimode,
    singlemode,
)
from .netlists import (
    flatten_netlist,
    netlist,
)
from .circuits import (
    circuit,
    draw_dag,
    get_required_circuit_models,
)
from . import backends
from .backends import (
    analyze_circuit,
    analyze_circuit_additive,
    analyze_circuit_fg,
    analyze_circuit_forward,
    analyze_instances,
    analyze_instances_additive,
    analyze_instances_fg,
    analyze_instances_forward,
    circuit_backends,
    evaluate_circuit,
    evaluate_circuit_additive,
    evaluate_circuit_fg,
    evaluate_circuit_forward,
)

from .ports import (
    PortNamer,
    set_port_naming_strategy,
    get_port_naming_strategy,
)

from .interpolation import (
    to_xarray,
    to_df,
    interpolate_xarray,
)

from . import fit
from .parsers import (
    parse_lumerical_dat,
    parse_touchstone,
    write_lumerical_dat,
    write_touchstone,
)
from . import models


__all__ = [  # noqa: RUF022
    "AnyNetlist",
    "ArrayLike",
    "Backend",
    "BackendLike",
    "Bool",
    "BoolArray",
    "BoolArrayLike",
    "BoolLike",
    "C_M_S",
    "C_UM_S",
    "CircuitInfo",
    "Complex",
    "ComplexArray",
    "ComplexArray1D",
    "ComplexArray1DLike",
    "ComplexArrayLike",
    "ComplexLike",
    "Component",
    "Connections",
    "DEFAULT_MODE",
    "DEFAULT_MODES",
    "DEFAULT_WL_STEP",
    "EPS",
    "ExperimentalWarning",
    "Float",
    "FloatArray",
    "FloatArray1D",
    "FloatArray1DLike",
    "FloatArray2D",
    "FloatArray2DLike",
    "FloatArrayLike",
    "FloatLike",
    "IOLike",
    "Instance",
    "InstanceName",
    "InstancePort",
    "Instances",
    "Int",
    "IntArray",
    "IntArray1D",
    "IntArray1DLike",
    "IntArrayLike",
    "IntLike",
    "Mode",
    "Model",
    "ModelFactory",
    "ModelFactoryMM",
    "ModelFactorySM",
    "ModelMM",
    "ModelSM",
    "Models",
    "ModelsMM",
    "ModelsSM",
    "Name",
    "Net",
    "Netlist",
    "Nets",
    "Normalization",
    "Placement",
    "Placements",
    "Port",
    "PortCombination",
    "PortCombinationMM",
    "PortCombinationSM",
    "PortMap",
    "PortMapMM",
    "PortMapSM",
    "PortMode",
    "PortNamer",
    "Ports",
    "RecursiveNetlist",
    "SCoo",
    "SCooMM",
    "SCooModel",
    "SCooModelFactory",
    "SCooModelFactoryMM",
    "SCooModelFactorySM",
    "SCooModelMM",
    "SCooModelSM",
    "SCooSM",
    "SDense",
    "SDenseMM",
    "SDenseModel",
    "SDenseModelFactory",
    "SDenseModelFactoryMM",
    "SDenseModelFactorySM",
    "SDenseModelMM",
    "SDenseModelSM",
    "SDenseSM",
    "SDict",
    "SDictMM",
    "SDictModel",
    "SDictModelFactory",
    "SDictModelFactoryMM",
    "SDictModelFactorySM",
    "SDictModelMM",
    "SDictModelSM",
    "SDictSM",
    "SType",
    "STypeMM",
    "STypeSM",
    "Settings",
    "SettingsValue",
    "WL_C",
    "WL_C_MAX",
    "WL_C_MIN",
    "WL_E",
    "WL_E_MAX",
    "WL_E_MIN",
    "WL_L",
    "WL_L_MAX",
    "WL_L_MIN",
    "WL_O",
    "WL_O_MAX",
    "WL_O_MIN",
    "WL_S",
    "WL_S_MAX",
    "WL_S_MIN",
    "analyze_circuit",
    "analyze_circuit_additive",
    "analyze_circuit_fg",
    "analyze_circuit_forward",
    "analyze_instances",
    "analyze_instances_additive",
    "analyze_instances_fg",
    "analyze_instances_forward",
    "backends",
    "block_diag",
    "cartesian_product",
    "circuit",
    "circuit_backends",
    "clean_string",
    "default_placement",
    "denormalize",
    "draw_dag",
    "evaluate_circuit",
    "evaluate_circuit_additive",
    "evaluate_circuit_fg",
    "evaluate_circuit_forward",
    "fit",
    "flatten_dict",
    "flatten_netlist",
    "get_mode",
    "get_modes",
    "get_port_combinations",
    "get_port_naming_strategy",
    "get_ports",
    "get_required_circuit_models",
    "get_settings",
    "grouped_interp",
    "hash_dict",
    "huber_loss",
    "interpolate_xarray",
    "into",
    "l2_reg",
    "load_netlist",
    "load_recursive_netlist",
    "maybe",
    "merge_dicts",
    "models",
    "mse",
    "multimode",
    "netlist",
    "normalization",
    "normalize",
    "parse_lumerical_dat",
    "parse_touchstone",
    "parsers",
    "read",
    "reciprocal",
    "rename_params",
    "rename_ports",
    "replace_kwargs",
    "same_args_as",
    "scoo",
    "sdense",
    "sdict",
    "set_port_naming_strategy",
    "singlemode",
    "to_df",
    "to_xarray",
    "try_into",
    "unflatten_dict",
    "update_settings",
    "wide_to_tidy",
    "wl_c",
    "wl_e",
    "wl_l",
    "wl_o",
    "wl_s",
    "write_lumerical_dat",
    "write_touchstone",
]
