From 7706c9abeb699b4188e72aafb1444d57f3d70b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaquier=20Aur=C3=A9lien=20Tristan?= Date: Thu, 3 Oct 2024 10:32:00 +0200 Subject: [PATCH 1/2] fix thumbanil for absolute amplitude protocols Change-Id: I86885c011854ca3f16c7f796c93e87d1cad3f846 --- bluepyemodel/tools/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bluepyemodel/tools/utils.py b/bluepyemodel/tools/utils.py index 73610b18..8c768257 100644 --- a/bluepyemodel/tools/utils.py +++ b/bluepyemodel/tools/utils.py @@ -230,7 +230,7 @@ def select_rec_for_thumbnail(rec_names, additional_step_prots=None, thumbnail_re if "LocalInjection" not in rec_name and any( step_prot.lower() in rec_name.lower() for step_prot in step_prots ): - prot_name = rec_name.split(".")[0] + prot_name = ".".join(rec_name.split(".")[:-2]) try: _, rec_amp = format_protocol_name_to_list(prot_name) if 0 < rec_amp < selected_amp: From b3ccd7893196e4551028b25a8f066e8ce605b901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaquier=20Aur=C3=A9lien=20Tristan?= Date: Thu, 3 Oct 2024 10:35:51 +0200 Subject: [PATCH 2/2] add test for test_select_rec_for_thumbnail Change-Id: I207efee537a7bc265f784eaa73ef9dc4bdc08a0e --- tests/unit_tests/test_tools.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/unit_tests/test_tools.py b/tests/unit_tests/test_tools.py index 7c14dab9..ba08cf0d 100644 --- a/tests/unit_tests/test_tools.py +++ b/tests/unit_tests/test_tools.py @@ -140,6 +140,15 @@ def test_select_rec_for_thumbnail(): select_rec_for_thumbnail(rec_names, thumbnail_rec="sAHP_20.soma.v") == "IDrest_130.soma.v" ) + # absolute amplitude with float amp case + rec_names = [ + "IDrest_0.2.soma.v", + "IDrest_-0.04.soma.v", + "IDrest_0.13.soma.v", + "sAHP_0.04.soma.v", + ] + assert select_rec_for_thumbnail(rec_names) == "IDrest_0.13.soma.v" + def test_get_protocol_name(): # feature keys