Skip to content

Commit 5df26a9

Browse files
Kirans0615HadleyKing
authored andcommitted
BCO scoring changes
1 parent 655d0d2 commit 5df26a9

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

biocompute/services.py

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,14 +608,36 @@ def bco_score(bco_instance: Bco) -> Bco:
608608
if "usability_domain" not in contents:
609609
bco_instance.score = 0
610610
return bco_instance
611-
611+
612612
try:
613613
usability_domain_length = sum(len(s) for s in contents['usability_domain'])
614614
score = {"usability_domain_length": usability_domain_length}
615615
except TypeError:
616616
score = {"usability_domain_length": 0}
617617
usability_domain_length = 0
618618

619-
bco_instance.score = usability_domain_length
620-
619+
# Calculate the base score
620+
base_score = usability_domain_length
621+
622+
# Apply the field length modifier
623+
field_length_modifier = 1.2
624+
base_score *= field_length_modifier
625+
626+
# Check for the existence of the error domain
627+
error_domain_exists = "error_domain" in contents
628+
if error_domain_exists:
629+
base_score += 5
630+
631+
# Apply the parametric object multiplier
632+
parametric_object_count = len(contents.get('parametric_objects', []))
633+
parametric_object_multiplier = 1.1
634+
base_score *= (parametric_object_multiplier ** parametric_object_count)
635+
636+
# Add score for each reviewer object (up to 5)
637+
reviewer_object_count = min(5, len(contents.get('reviewer_objects', [])))
638+
base_score += reviewer_object_count
639+
640+
# Finalize the score
641+
bco_instance.score = base_score
642+
621643
return bco_instance

0 commit comments

Comments
 (0)