Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit 3be0b7d

Browse files
Merge pull request #174 from BlueBrain/fix-thumbnail
fix thumbanil for absolute amplitude protocols
2 parents 1ce624a + b3ccd78 commit 3be0b7d

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

bluepyemodel/tools/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def select_rec_for_thumbnail(rec_names, additional_step_prots=None, thumbnail_re
230230
if "LocalInjection" not in rec_name and any(
231231
step_prot.lower() in rec_name.lower() for step_prot in step_prots
232232
):
233-
prot_name = rec_name.split(".")[0]
233+
prot_name = ".".join(rec_name.split(".")[:-2])
234234
try:
235235
_, rec_amp = format_protocol_name_to_list(prot_name)
236236
if 0 < rec_amp < selected_amp:

tests/unit_tests/test_tools.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@ def test_select_rec_for_thumbnail():
140140
select_rec_for_thumbnail(rec_names, thumbnail_rec="sAHP_20.soma.v") == "IDrest_130.soma.v"
141141
)
142142

143+
# absolute amplitude with float amp case
144+
rec_names = [
145+
"IDrest_0.2.soma.v",
146+
"IDrest_-0.04.soma.v",
147+
"IDrest_0.13.soma.v",
148+
"sAHP_0.04.soma.v",
149+
]
150+
assert select_rec_for_thumbnail(rec_names) == "IDrest_0.13.soma.v"
151+
143152

144153
def test_get_protocol_name():
145154
# feature keys

0 commit comments

Comments
 (0)