Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinDo committed Jan 18, 2024
1 parent aeddbd3 commit 886beb4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/frontend_celery/webapp/io/download_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,9 @@ def calculate_class(scheme_type = None, version = None, selected_classes = ''):
return jsonify({'final_class': '-'})

selected_classes = selected_classes.split('+')
#scheme = request.args.get('scheme')

#print(scheme_type)
#print(version)
#print(selected_classes)

final_class = None
Expand Down
4 changes: 2 additions & 2 deletions src/frontend_celery/webapp/variant/variant_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def extract_criteria_from_request(request_obj, scheme_id, conn: Connection):
return criteria

# criteria dict from the extract criteria request function is the input
def get_scheme_class(criteria_dict, scheme_type):
def get_scheme_class(criteria_dict, scheme_type, version):
all_criteria_strengths = []
keyval = 'strength'
if scheme_type == 'task-force':
Expand All @@ -367,7 +367,7 @@ def get_scheme_class(criteria_dict, scheme_type):
if criteria_dict[key]['is_selected'] == 1:
all_criteria_strengths.append(criteria_dict[key][keyval])
all_criteria_string = '+'.join(all_criteria_strengths)
scheme_class = calculate_class(scheme_type, all_criteria_string)
scheme_class = calculate_class(scheme_type, version, all_criteria_string)
return scheme_class


Expand Down
4 changes: 2 additions & 2 deletions src/frontend_celery/webapp/variant/variant_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def classify(variant_id):
scheme_id_is_valid = True
if not without_scheme:
if scheme_id in classification_schemas:
scheme_class = get_scheme_class(criteria, classification_schemas[scheme_id]['scheme_type'])
scheme_class = get_scheme_class(criteria, classification_schemas[scheme_id]['scheme_type'], classification_schemas[scheme_id]['version'])
scheme_class = scheme_class.json['final_class']
else:
flash("Unknown or deprecated classification scheme provided. Please provide a different one.", "alert-danger")
Expand Down Expand Up @@ -528,7 +528,7 @@ def consensus_classify(variant_id):

scheme_id_is_valid = True
if scheme_id in classification_schemas:
scheme_class = get_scheme_class(criteria, classification_schemas[scheme_id]['scheme_type']) # always calculate scheme class because no scheme is not allowed here!
scheme_class = get_scheme_class(criteria, classification_schemas[scheme_id]['scheme_type'], classification_schemas[scheme_id]['version']) # always calculate scheme class because no scheme is not allowed here!
scheme_class = scheme_class.json['final_class']
else:
flash("Unknown or deprecated classification scheme provided. Please provide a different one.", "alert-danger")
Expand Down

0 comments on commit 886beb4

Please sign in to comment.