From 9ae0a00364ac087cf4b568c4615084cb37901f1a Mon Sep 17 00:00:00 2001 From: Thorsten Hater <24411438+thorstenhater@users.noreply.github.com> Date: Mon, 20 Apr 2026 08:15:47 +0200 Subject: [PATCH 1/2] Fix normalisation, add regression test, begin 0.12.1 --- VERSION | 2 +- modcc/solvers.cpp | 2 +- pyproject.toml | 2 +- python/example/single_cell_allen.py | 4 +++- python/single_cell_model.cpp | 2 +- scripts/run_python_examples.sh | 1 + 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index ac454c6a1..a3283ce85 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.12.0 +0.12.1-rc diff --git a/modcc/solvers.cpp b/modcc/solvers.cpp index 9cd65ec5b..f02d2cd7c 100644 --- a/modcc/solvers.cpp +++ b/modcc/solvers.cpp @@ -12,7 +12,7 @@ #include "visitor.hpp" // normalize row iff system is larger than this -constexpr int normalization_limit = 15; +constexpr int normalization_limit = 5; // Cnexp solver visitor implementation. diff --git a/pyproject.toml b/pyproject.toml index 15fee8d9c..a9df70706 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -134,7 +134,7 @@ archs = ["arm64"] environment = { MACOSX_DEPLOYMENT_TARGET = "14.0" } [tool.cibuildwheel.linux] -archs = ["x86_64"] +archs = ["x86_64", "arm64"] [[tool.cibuildwheel.overrides]] select = "*-musllinux*" diff --git a/python/example/single_cell_allen.py b/python/example/single_cell_allen.py index 8d2c9a1a8..22717ce79 100644 --- a/python/example/single_cell_allen.py +++ b/python/example/single_cell_allen.py @@ -177,8 +177,9 @@ def make_cell(base, swc, fit): ) sns.relplot(data=df, kind="line", x="t/ms", y="U/mV", hue="Simulator", errorbar=None) +spikes = model.spikes[:] plt.scatter( - model.spikes, [-40] * len(model.spikes), color=sns.color_palette()[2], zorder=20 + spikes, [-40] * len(spikes), color=sns.color_palette()[2], zorder=20 ) plt.bar( 200, @@ -190,3 +191,4 @@ def make_cell(base, swc, fit): color="0.9", ) plt.savefig("single_cell_allen_result.pdf") +assert len(spikes) == 4, f"Expected four spikes, got {spikes}" diff --git a/python/single_cell_model.cpp b/python/single_cell_model.cpp index 5ea09ecbc..4b7f73b77 100644 --- a/python/single_cell_model.cpp +++ b/python/single_cell_model.cpp @@ -199,7 +199,7 @@ class single_cell_model { } // Set callback that records spike times. - sim_->set_global_spike_callback( + sim_->set_local_spike_callback( [this](const std::vector& spikes) { for (auto& s: spikes) { spike_times_.push_back(s.time); diff --git a/scripts/run_python_examples.sh b/scripts/run_python_examples.sh index c4f9b9e0f..c1900b6d6 100755 --- a/scripts/run_python_examples.sh +++ b/scripts/run_python_examples.sh @@ -29,6 +29,7 @@ runpyex single_cell_model.py runpyex single_cell_nml.py python/example/morph.nml runpyex single_cell_recipe.py runpyex single_cell_stdp.py +runpyex single_cell_allen.py runpyex single_cell_swc.py python/example/single_cell_detailed.swc runpyex network_ring.py # runpyex network_ring_mpi.py # requires MPI From 75885d0f82c75e9a3cecdb907b8b40331e3392a4 Mon Sep 17 00:00:00 2001 From: Thorsten Hater <24411438+thorstenhater@users.noreply.github.com> Date: Mon, 20 Apr 2026 08:19:47 +0200 Subject: [PATCH 2/2] Format --- python/example/single_cell_allen.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/example/single_cell_allen.py b/python/example/single_cell_allen.py index 22717ce79..67123e7a4 100644 --- a/python/example/single_cell_allen.py +++ b/python/example/single_cell_allen.py @@ -178,9 +178,7 @@ def make_cell(base, swc, fit): sns.relplot(data=df, kind="line", x="t/ms", y="U/mV", hue="Simulator", errorbar=None) spikes = model.spikes[:] -plt.scatter( - spikes, [-40] * len(spikes), color=sns.color_palette()[2], zorder=20 -) +plt.scatter(spikes, [-40] * len(spikes), color=sns.color_palette()[2], zorder=20) plt.bar( 200, max(reference) - min(reference),