mirror of
https://gitea.psi.ch/APOG/acsm-fairifier.git
synced 2025-07-08 09:01:20 +02:00
Enable all flaggs for use in flagging app and display them in order according to their ranking (see app/flags/ebas_dict.yaml)
This commit is contained in:
@ -32,18 +32,24 @@ def save_file(name, content):
|
||||
def filter_flags_by_label(flags_dict, label):
|
||||
"""
|
||||
Filters the flags dictionary by the specified label.
|
||||
If label is 'all', returns all flags without filtering.
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
flags_dict (dict): The dictionary containing flags.
|
||||
label (str): The label to filter by ('I' or 'V').
|
||||
label (str): The label to filter by ('I', 'V', or 'all').
|
||||
|
||||
Returns:
|
||||
--------
|
||||
list: A list of dictionaries with 'label' and 'value' for the specified label.
|
||||
list: A list of dictionaries with 'label' and 'value' for the specified label,
|
||||
or all flags if label is 'all'.
|
||||
"""
|
||||
return [{'label': value['description'], 'value': code}
|
||||
for code, value in flags_dict.items() if value['validity'] == label]
|
||||
return [
|
||||
{'label': value['description'], 'value': code}
|
||||
for code, value in flags_dict.items()
|
||||
if label == 'all' or value['validity'] == label
|
||||
]
|
||||
|
||||
|
||||
|
||||
def create_loaded_file_figure(file_path, instFolder, dataset_name, datetime_var, datetime_var_format, variables):
|
||||
|
Reference in New Issue
Block a user