Skip to content

Commit

Permalink
[dupExpPhase] improving complexity by dict insted of list
Browse files Browse the repository at this point in the history
  • Loading branch information
NoaShapira8 committed May 17, 2024
1 parent 514773a commit 142093d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src_py/apiServer/experiment_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ def parse_experiment_flow_json(self, json_path : str, override_csv_path = ""):
num_of_labels = self.exp_flow_json[EXPFLOW_NUM_OF_LABELS_FIELD]
self.set_csv_dataset(csv_file_path, num_of_features, num_of_labels, headers_row)
phases_list = self.exp_flow_json[EXPFLOW_PHASES_FIELD]
phases_names_list = []
phases_names_dict= {}
phase_index = 1
for phase in phases_list:
phase_name = phase[EXPFLOW_PHASES_PHASE_NAME_FIELD]
assert phase_name not in phases_names_list , "check for duplicate phase names"
phases_names_list.append(phase_name)
assert phase_name not in phases_names_dict , "check for duplicate phase names"
phases_names_dict.update({phase_name: phase_index})
phase_index += 1
phase_type = phase[EXPFLOW_PHASES_PHASE_TYPE_FIELD]
sourcePieces = phase[EXPFLOW_PHASES_PHASE_SOURCE_PIECES_FIELD]
source_pieces_inst_list = []
Expand Down

0 comments on commit 142093d

Please sign in to comment.