From 6cfedaa7d32f12b993c4e172ae5bdb8283e12ff5 Mon Sep 17 00:00:00 2001 From: henriquenakashima Date: Thu, 29 Jul 2021 00:31:34 -0400 Subject: [PATCH] Fix some scripts --- cubecobra_csv.py | 1 + fill360.py | 7 ++++++- word_count.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cubecobra_csv.py b/cubecobra_csv.py index 4a7d563..3f8ddeb 100644 --- a/cubecobra_csv.py +++ b/cubecobra_csv.py @@ -45,6 +45,7 @@ _COLOR_CATEGORIES = { 'Red': 'r', 'Green': 'g', 'Multicolor': 'm', + 'Multicolored': 'm', 'Hybrid': 'h', 'Colorless': 'c', 'Land': 'land', diff --git a/fill360.py b/fill360.py index ac399be..03124e8 100644 --- a/fill360.py +++ b/fill360.py @@ -28,7 +28,7 @@ def get_copies_to_add(card): if tag == 'uncommon': return [card] * (2 - 1) if tag == 'dual': - return [card] * (7 - 1) + return [card] * (8 - 1) return [] @@ -37,9 +37,14 @@ def main(): cube: List[CubeCard] = cubecobra_csv.load_cube(csv_path) names_to_add = [] + unique_cards = set() for card in cube: copies_to_add = get_copies_to_add(card) names_to_add.extend([card.name for card in copies_to_add]) + unique_cards.add(card.name) + + print(f'Unique cards: {len(unique_cards)}') + print(f'Total cards: {len(cube)}') with open(OUTPUT_FILENAME, 'wb') as f: full_pool_contents = '\n'.join(names_to_add).encode('utf-8') diff --git a/word_count.py b/word_count.py index 1f99577..47c6a93 100644 --- a/word_count.py +++ b/word_count.py @@ -170,7 +170,7 @@ if __name__ == '__main__': # 1. If you have your cube in Cube Cobra and want to filter per tag # csv_path = cubecobra_csv.request_cube_csv('TheElegantCube_fetched', 'elegant') - # cube_list = cube_json.load_cube_from_csv(csv_path) + # cube_list = cubecobra_csv.load_cube_names(csv_path) # 2. If you have your cube in Cube Cobra and want to consider only cards with a certain tag csv_path = cubecobra_csv.request_cube_csv('TheElegantCube_fetched', 'elegant')