diff --git a/analyze_wotb_replays.py b/analyze_wotb_replays.py index c0bcabf..8ddd7e1 100644 --- a/analyze_wotb_replays.py +++ b/analyze_wotb_replays.py @@ -550,6 +550,16 @@ async def main(argv): except (KeyError, configparser.NoSectionError) as err: bu.error(exception=err) + try: + if 'ANALYZER' in config.sections(): + configAnalyzer = config['ANALYZER'] + histogram_fields_str = configAnalyzer.get('histogram_buckets', None) + if histogram_fields_str != None: + set_histogram_buckets(json.loads(histogram_fields_str)) + + except (KeyError, configparser.NoSectionError) as err: + bu.error(exception=err) + try: if 'WG' in config.sections(): configWG = config['WG'] @@ -690,6 +700,17 @@ async def main(argv): if wi != None: await wi.close() return None + +def set_histogram_buckets(json: dict): + global histogram_fields + try: + for field in json.keys(): + histogram_fields[field][1] = json[field] + except (KeyError, Exception) as err: + bu.error(exception=err) + return histogram_fields + + def process_player_dist(results: list, player_stats: dict, stat_id_map: dict): """Process player distribution""" hist_stats = dict()