sc_neurocore_engine/bindings/population/
wendling.rs1use pyo3::prelude::*;
10
11use crate::neurons;
12
13#[pyclass(
14 name = "WendlingNeuron",
15 module = "sc_neurocore_engine.sc_neurocore_engine"
16)]
17#[derive(Clone)]
18pub struct PyWendlingNeuron {
19 inner: neurons::WendlingNeuron,
20}
21
22#[pymethods]
23impl PyWendlingNeuron {
24 #[new]
25 fn new() -> Self {
26 Self {
27 inner: neurons::WendlingNeuron::new(),
28 }
29 }
30
31 #[pyo3(signature = (p_ext=220.0))]
32 fn step(&mut self, p_ext: f64) -> f64 {
33 self.inner.step(p_ext)
34 }
35
36 fn reset(&mut self) {
37 self.inner.reset();
38 }
39}
40
41pub(super) fn register(module: &Bound<'_, PyModule>) -> PyResult<()> {
42 module.add_class::<PyWendlingNeuron>()?;
43 Ok(())
44}