From 906d5068abb8a101e71ed010cda5400f3e17090a Mon Sep 17 00:00:00 2001 From: arnaudon Date: Tue, 1 Oct 2024 10:15:39 +0200 Subject: [PATCH 1/4] Fix: Fix no spike case when expected --- emodel_generalisation/bluecellulab_evaluator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/emodel_generalisation/bluecellulab_evaluator.py b/emodel_generalisation/bluecellulab_evaluator.py index 9884765..2fd8085 100644 --- a/emodel_generalisation/bluecellulab_evaluator.py +++ b/emodel_generalisation/bluecellulab_evaluator.py @@ -190,7 +190,7 @@ def calculate_rmp_and_rin(cell, config): if features["spike_count"] > 0: logger.warning("SPIKES! %s, %s", rmp, rin) - return 0.0, -1.0 + return 0.0, 0.0 return rmp, rin @@ -281,7 +281,6 @@ def evaluate_currents( new_columns = [["resting_potential", 0.0], ["input_resistance", 0.0]] if not only_rin: new_columns += [["holding_current", 0.0], ["threshold_current", 0.0]] - return evaluate( morphs_combos_df, _isolated_current_evaluation, From e80fe7ecc9bcb5a8fa0c69d7a936b30021fb2ca2 Mon Sep 17 00:00:00 2001 From: arnaudon Date: Tue, 1 Oct 2024 10:28:08 +0200 Subject: [PATCH 2/4] fix test --- tests/test_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 1b33d5a..f57964d 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -201,7 +201,7 @@ def test_adapt(cli_runner, tmpdir): ) npt.assert_allclose( df["@dynamics:input_resistance"].to_list(), - [-1.0, -1.0], # we get spikes at rest + [0.0, 0.0], # we get spikes at rest rtol=1e-5, ) npt.assert_allclose( From c209c2a007891e50f98e40fbc04efe4ded3dbce0 Mon Sep 17 00:00:00 2001 From: arnaudon Date: Mon, 14 Oct 2024 16:07:02 +0200 Subject: [PATCH 3/4] fix region/subregion in cli --- emodel_generalisation/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/emodel_generalisation/cli.py b/emodel_generalisation/cli.py index 5f1584d..b774809 100644 --- a/emodel_generalisation/cli.py +++ b/emodel_generalisation/cli.py @@ -572,10 +572,13 @@ def assign(input_node_path, population_name, output_node_path, config_path, loca recipe = access_point.recipes[emodel] emodel_mappings[recipe["region"]][recipe["etype"]][recipe["mtype"]] = emodel + regions = list(emodel_mappings.keys()) + def assign_emodel(row): """Get emodel name to use in pandas .apply.""" try: - return "hoc:" + emodel_mappings[row["region"]][row["etype"]][row["mtype"]] + region = [r for r in regions if r in row["region"]][0] + return "hoc:" + emodel_mappings[region][row["etype"]][row["mtype"]] except KeyError: return "hoc:no_emodel" From 0247117e54aee9727d4ea488c35bb3207c26be7b Mon Sep 17 00:00:00 2001 From: arnaudon Date: Mon, 14 Oct 2024 16:08:32 +0200 Subject: [PATCH 4/4] fix test --- tests/test_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index f57964d..f2d1b50 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -206,7 +206,7 @@ def test_adapt(cli_runner, tmpdir): ) npt.assert_allclose( df["@dynamics:holding_current"].to_list(), - [-0.064316, -0.081205], + [-0.064313, -0.081205], rtol=1e-5, ) npt.assert_allclose(