diff --git a/AIAgent/common/utils.py b/AIAgent/common/utils.py index e7b0a9ac..977a99d4 100644 --- a/AIAgent/common/utils.py +++ b/AIAgent/common/utils.py @@ -18,6 +18,6 @@ def invert_mapping_mrgm_gmmr( for map_result_mapping in list_of_map_result_mappings: map, result = (map_result_mapping.map, map_result_mapping.game_result) - inverse_mapping[map].append(Agent2Result(named_agent, result)) + inverse_mapping[map.MapName].append(Agent2Result(named_agent, result)) return inverse_mapping diff --git a/AIAgent/epochs_statistics/tables.py b/AIAgent/epochs_statistics/tables.py index a7a63686..cbd89df0 100644 --- a/AIAgent/epochs_statistics/tables.py +++ b/AIAgent/epochs_statistics/tables.py @@ -50,15 +50,15 @@ def create_pivot_table( model_map_results_mapping ) - name_results_dict: defaultdict[int, list[Name2ResultViewModel]] = defaultdict(list) - epoch_percents_dict: defaultdict[int, list[Name2ResultViewModel]] = defaultdict( + name_results_dict: defaultdict[str, list[Name2ResultViewModel]] = defaultdict(list) + epoch_percents_dict: defaultdict[str, list[Name2ResultViewModel]] = defaultdict( list ) - for map_obj, mutable2result_list in map_results_with_models.items(): + for mapName, mutable2result_list in map_results_with_models.items(): for mutable2result in mutable2result_list: - name_results_dict[map_obj.Id].append(convert_to_view_model(mutable2result)) - epoch_percents_dict[map_obj.Id].append( + name_results_dict[mapName].append(convert_to_view_model(mutable2result)) + epoch_percents_dict[mapName].append( str( ( mutable2result.game_result.actual_coverage_percent, @@ -75,12 +75,6 @@ def create_pivot_table( for col in df: df[col] = df[col].map(lambda name2result_vm: name2result_vm.pretty_result) - maps_indexes = dict( - {(map_obj.Id, map_obj.MapName) for map_obj in map_results_with_models.keys()} - ) - - df.rename(columns=lambda map_id: maps_indexes[map_id], inplace=True) - epochs_percent_df.rename(columns=lambda map_id: maps_indexes[map_id], inplace=True) df[EUC_DIST2FULL_COV_COL_NAME] = euc_dists2full_cov df[AV_COVERAGE_COL_NAME] = avs df[MEDIAN_COVERAGE_COL_NAME] = medians diff --git a/requirements.txt b/requirements.txt index b957fa98..c31d668d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -59,6 +59,7 @@ scipy==1.11.4 six==1.16.0 SQLAlchemy==2.0.25 sympy==1.12 +tabulate=0.9.0 threadpoolctl==3.2.0 torch==2.1.2 torch_geometric==2.4.0