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
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bluepyemodel/validation/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ def compute_scores(model, validation_protocols):

scores = model.evaluator.fitness_calculator.calculate_scores(model.responses)
for feature_name in scores:
protocol_name = feature_name.split(".")[0]
n = feature_name.split(".")
# case where protocol has '.' in its name, e.g. IV_40.0
if n[1].isdigit():
n = [".".join(n[:2])] + n[2:]
protocol_name = n[0]
if any(are_same_protocol(p, protocol_name) for p in validation_protocols):
model.scores_validation[feature_name] = scores[feature_name]
else:
Expand Down
Loading