-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compute_scores to handle protocol names with '.' #166
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #166 +/- ##
==========================================
- Coverage 60.07% 52.74% -7.34%
==========================================
Files 109 124 +15
Lines 7838 10353 +2515
==========================================
+ Hits 4709 5461 +752
- Misses 3129 4892 +1763 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you!
We have similar code in emodel_pipeline.plotting_utils and in tools.utils for protocol name. Could you maybe make a function that we can call so that we don't duplicate code (if we can make something that works for both protocol name and feature name)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
bluepyemodel/tools/utils.py
Outdated
|
||
return float(protocol_name.split("_")[-1]) | ||
|
||
|
||
def combine_parts_if_dot_in_protocol(feature_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you say for this function and get_protocol_name and get_loc_name and get_curr_name in their docstrings that it works both with a feature str (e.g. "IV_40.0.soma.v.voltage_base") and for a response key (e.g.""IV_40.0.soma.v"). Also adding examples of expected names would be a +
@@ -136,3 +139,38 @@ def test_select_rec_for_thumbnail(): | |||
assert ( | |||
select_rec_for_thumbnail(rec_names, thumbnail_rec="sAHP_20.soma.v") == "IDrest_130.soma.v" | |||
) | |||
|
|||
|
|||
def test_get_protocol_name(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the tests could you also try with strings from response keys (i.e. without the feature at the end, e.g. 'IV_40.0.soma.v')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! This is maybe the most thorough docstrings of all BPEM. Great job!
No description provided.