# SPDX-License-Identifier: AGPL-3.0-or-later | Commercial license available
# © Concepts 1996–2026 Miroslav Šotek. All rights reserved.
# © Code 2020–2026 Miroslav Šotek. All rights reserved.
# ORCID: 0009-0009-3560-0851
# Contact: www.anulum.li | protoscience@anulum.li
# SC-NeuroCore — neuron library - every published model, one file each

"""SC-NeuroCore neuron library - every published model, one file each.

Auto-dispatch
-------------
When the Rust engine (``sc_neurocore_engine``) is available,
``from sc_neurocore.neurons import X`` transparently returns the Rust
implementation.  ``from sc_neurocore.neurons.models import X`` always
returns the pure-Python version.

Set the environment variable ``SC_NEUROCORE_NO_RUST=1`` to force the
pure-Python path even when the Rust engine is present.
"""

from .base import BaseNeuron
from .stochastic_lif import StochasticLIFNeuron
from .fixed_point_lif import FixedPointLIFNeuron, FixedPointLFSR, FixedPointBitstreamEncoder
from .homeostatic_lif import HomeostaticLIFNeuron
from .dendritic import StochasticDendriticNeuron
from .sc_izhikevich import SCIzhikevichNeuron

from .models import (
    AdExNeuron,
    AdaptiveThresholdIFNeuron,
    AkidaNeuron,
    AlphaNeuron,
    AmariNeuralField,
    AstrocyteModel,
    AvRonCardiacNeuron,
    BendaHerzNeuron,
    BertramPhantomBurster,
    BoothRinzelNeuron,
    BrainScaleSAdExNeuron,
    ButeraRespiratoryNeuron,
    COBALIFNeuron,
    CazellesMapNeuron,
    ChayKeizerNeuron,
    ChayNeuron,
    ChialvoMapNeuron,
    ClosedFormContinuousNeuron,
    ComplementaryLIFNeuron,
    CompteWMNeuron,
    ConnorStevensNeuron,
    CourageNekorkinMapNeuron,
    DPINeuron,
    DeSchutterPurkinjeNeuron,
    DendrifyNeuron,
    DestexheThalamicNeuron,
    DurstewitzDopamineNeuron,
    EPropALIFNeuron,
    EnergyLIFNeuron,
    ErmentroutKopellPopulation,
    EscapeRateNeuron,
    ExpIFNeuron,
    FitzHughNagumoNeuron,
    FitzHughRinzelNeuron,
    FractionalLIFNeuron,
    GIFPopulationNeuron,
    GLIFNeuron,
    GLMNeuron,
    GalvesLocherbachNeuron,
    GammaRenewalNeuron,
    GatedLIFNeuron,
    GolombFSNeuron,
    GutkinErmentroutNeuron,
    HayL5PyramidalNeuron,
    HillTononiNeuron,
    HindmarshRoseNeuron,
    HodgkinHuxleyNeuron,
    HuberBraunNeuron,
    IbarzTanakaMapNeuron,
    InhibitoryLIFNeuron,
    InhomogeneousPoissonNeuron,
    IntegerQIFNeuron,
    JansenRitUnit,
    KLIFNeuron,
    LapicqueNeuron,
    LarterBreakspearNeuron,
    LeakyCompeteFireNeuron,
    LearnableNeuronModel,
    LiquidTimeConstantNeuron,
    Loihi2Neuron,
    LoihiCUBANeuron,
    MATNeuron,
    MainenSejnowskiNeuron,
    MarderSTGNeuron,
    McCullochPittsNeuron,
    McKeanNeuron,
    MedvedevMapNeuron,
    MihalasNieburNeuron,
    MorrisLecarNeuron,
    NeuroGridNeuron,
    NonResettingLIFNeuron,
    NonlinearLIFNeuron,
    ParallelSpikingNeuron,
    ParametricLIFNeuron,
    PerfectIntegratorNeuron,
    PernarowskiNeuron,
    PinskyRinzelNeuron,
    PlantR15Neuron,
    PoissonNeuron,
    PospischilNeuron,
    PrescottNeuron,
    QuadraticIFNeuron,
    RallCableNeuron,
    ResonateAndFireNeuron,
    RulkovMapNeuron,
    SFANeuron,
    ShermanRinzelKeizerNeuron,
    SiegertTransferFunction,
    SigmaDeltaNeuron,
    SigmoidRateNeuron,
    SpiNNaker2Neuron,
    SpiNNakerLIFNeuron,
    SpikeResponseNeuron,
    StochasticIFNeuron,
    SuperSpikeNeuron,
    TermanWangOscillator,
    ThetaNeuron,
    ThresholdLinearRateNeuron,
    TraubMilesNeuron,
    TrueNorthNeuron,
    TsodyksMarkramNeuron,
    TwoCompartmentLIFNeuron,
    WangBuzsakiNeuron,
    WendlingNeuron,
    WilsonCowanUnit,
    WilsonHRNeuron,
    WongWangUnit,
    YamadaNeuron,
)

__all__ = [
    "BaseNeuron",
    "StochasticLIFNeuron",
    "FixedPointLIFNeuron",
    "FixedPointLFSR",
    "FixedPointBitstreamEncoder",
    "HomeostaticLIFNeuron",
    "StochasticDendriticNeuron",
    "SCIzhikevichNeuron",
    "AdExNeuron",
    "AdaptiveThresholdIFNeuron",
    "AkidaNeuron",
    "AlphaNeuron",
    "AmariNeuralField",
    "AstrocyteModel",
    "AvRonCardiacNeuron",
    "BendaHerzNeuron",
    "BertramPhantomBurster",
    "BoothRinzelNeuron",
    "BrainScaleSAdExNeuron",
    "ButeraRespiratoryNeuron",
    "COBALIFNeuron",
    "CazellesMapNeuron",
    "ChayKeizerNeuron",
    "ChayNeuron",
    "ChialvoMapNeuron",
    "ClosedFormContinuousNeuron",
    "ComplementaryLIFNeuron",
    "CompteWMNeuron",
    "ConnorStevensNeuron",
    "CourageNekorkinMapNeuron",
    "DPINeuron",
    "DeSchutterPurkinjeNeuron",
    "DendrifyNeuron",
    "DestexheThalamicNeuron",
    "DurstewitzDopamineNeuron",
    "EPropALIFNeuron",
    "EnergyLIFNeuron",
    "ErmentroutKopellPopulation",
    "EscapeRateNeuron",
    "ExpIFNeuron",
    "FitzHughNagumoNeuron",
    "FitzHughRinzelNeuron",
    "FractionalLIFNeuron",
    "GIFPopulationNeuron",
    "GLIFNeuron",
    "GLMNeuron",
    "GalvesLocherbachNeuron",
    "GammaRenewalNeuron",
    "GatedLIFNeuron",
    "GolombFSNeuron",
    "GutkinErmentroutNeuron",
    "HayL5PyramidalNeuron",
    "HillTononiNeuron",
    "HindmarshRoseNeuron",
    "HodgkinHuxleyNeuron",
    "HuberBraunNeuron",
    "IbarzTanakaMapNeuron",
    "InhibitoryLIFNeuron",
    "InhomogeneousPoissonNeuron",
    "IntegerQIFNeuron",
    "JansenRitUnit",
    "KLIFNeuron",
    "LapicqueNeuron",
    "LarterBreakspearNeuron",
    "LeakyCompeteFireNeuron",
    "LearnableNeuronModel",
    "LiquidTimeConstantNeuron",
    "Loihi2Neuron",
    "LoihiCUBANeuron",
    "MATNeuron",
    "MainenSejnowskiNeuron",
    "MarderSTGNeuron",
    "McCullochPittsNeuron",
    "McKeanNeuron",
    "MedvedevMapNeuron",
    "MihalasNieburNeuron",
    "MorrisLecarNeuron",
    "NeuroGridNeuron",
    "NonResettingLIFNeuron",
    "NonlinearLIFNeuron",
    "ParallelSpikingNeuron",
    "ParametricLIFNeuron",
    "PerfectIntegratorNeuron",
    "PernarowskiNeuron",
    "PinskyRinzelNeuron",
    "PlantR15Neuron",
    "PoissonNeuron",
    "PospischilNeuron",
    "PrescottNeuron",
    "QuadraticIFNeuron",
    "RallCableNeuron",
    "ResonateAndFireNeuron",
    "RulkovMapNeuron",
    "SFANeuron",
    "ShermanRinzelKeizerNeuron",
    "SiegertTransferFunction",
    "SigmaDeltaNeuron",
    "SigmoidRateNeuron",
    "SpiNNaker2Neuron",
    "SpiNNakerLIFNeuron",
    "SpikeResponseNeuron",
    "StochasticIFNeuron",
    "SuperSpikeNeuron",
    "TermanWangOscillator",
    "ThetaNeuron",
    "ThresholdLinearRateNeuron",
    "TraubMilesNeuron",
    "TrueNorthNeuron",
    "TsodyksMarkramNeuron",
    "TwoCompartmentLIFNeuron",
    "WangBuzsakiNeuron",
    "WendlingNeuron",
    "WilsonCowanUnit",
    "WilsonHRNeuron",
    "WongWangUnit",
    "YamadaNeuron",
]

# -- Rust auto-dispatch: replace Python classes with Rust when engine available --
import os as _os

if not _os.environ.get("SC_NEUROCORE_NO_RUST"):
    try:  # pragma: no cover
        from sc_neurocore_engine import sc_neurocore_engine as _eng

        _rust_map = {name: getattr(_eng, name) for name in __all__ if hasattr(_eng, name)}
        globals().update(_rust_map)
    except ImportError:  # pragma: no cover
        pass
