Skip to content
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

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

ilkilic
Copy link
Collaborator

@ilkilic ilkilic commented Aug 28, 2024

No description provided.

@ilkilic ilkilic self-assigned this Aug 28, 2024
@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 97.18310% with 2 lines in your changes missing coverage. Please review.

Project coverage is 52.74%. Comparing base (8d5b0ab) to head (e52d1f3).
Report is 80 commits behind head on main.

Files Patch % Lines
bluepyemodel/emodel_pipeline/plotting_utils.py 85.71% 1 Missing ⚠️
bluepyemodel/tools/utils.py 94.44% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@AurelienJaquier AurelienJaquier left a 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)?

Copy link
Collaborator

@AurelienJaquier AurelienJaquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!


return float(protocol_name.split("_")[-1])


def combine_parts_if_dot_in_protocol(feature_name):
Copy link
Collaborator

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():
Copy link
Collaborator

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')

Copy link
Collaborator

@AurelienJaquier AurelienJaquier left a 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!

@ilkilic ilkilic merged commit 81d90c2 into main Aug 28, 2024
6 checks passed
@ilkilic ilkilic deleted the fix-thresh-amp-val branch August 28, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants