def ad_hoc() -> None: archetypes = archetype.load_archetypes() for a in archetypes: print(f'Generating Similar Decks for {a.name} ({len(a.decks)} decks)') s = time.perf_counter() deck.calculate_similar_decks(a.decks) t = time.perf_counter() - s print(f'Completed {len(a.decks)} decks in {t}')
def run() -> None: decks = deck.load_decks('NOT reviewed') deck.calculate_similar_decks(decks) for d in decks: for s in d.similar_decks: if s.reviewed and s.archetype_id is not None: sim = int(100 * deck.similarity_score(d, s)) archetype.assign(d.id, s.archetype_id, None, False, sim) break
def guess_archetypes(ds: List[deck.Deck]) -> None: deck.calculate_similar_decks(ds) for d in ds: if d.similar_decks: archetype.assign(d.id, d.similar_decks[0].archetype_id, False)