Skip to content

Commit

Permalink
Merge pull request #174 from BlueBrain/fix-thumbnail
Browse files Browse the repository at this point in the history
fix thumbanil for absolute amplitude protocols
  • Loading branch information
AurelienJaquier authored Oct 3, 2024
2 parents 1ce624a + b3ccd78 commit 3be0b7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bluepyemodel/tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions tests/unit_tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3be0b7d

Please sign in to comment.