mtg_python_deckbuilder/code/scripts
matt bff64de370 fix: systematically handle numpy arrays from Parquet files across codebase
- Add ensure_theme_tags_list() utility to builder_utils for simpler numpy array handling
- Update phase3_creatures.py: 6 locations now use bu.ensure_theme_tags_list()
- Update phase4_spells.py: 9 locations now use bu.ensure_theme_tags_list()
- Update tagger.py: 2 locations use hasattr/list() for numpy compatibility
- Update extract_themes.py: 2 locations use hasattr/list() for numpy compatibility
- Fix build-similarity-cache.yml verification script to handle numpy arrays
- Enhance workflow debug output to show complete row data

Parquet files return numpy.ndarray objects for array columns, not Python lists.
The M4 migration added numpy support to canonical parse_theme_tags() in builder_utils,
but many parts of the codebase still used isinstance(list) checks that fail with arrays.
This commit systematically replaces all 19 instances with proper numpy array handling.

Fixes GitHub Actions workflow 'RuntimeError: No theme tags found' and verification failures.
2025-10-18 22:47:09 -07:00
..
aggregate_cards.py feat: consolidate card data into optimized format for faster queries and reduced file sizes 2025-10-15 11:04:49 -07:00
apply_next_theme_editorial.py feat(editorial): Phase D synergy commander enrichment, augmentation, lint & docs\n\nAdds Phase D editorial tooling: synergy-based commander selection with 3/2/1 pattern, duplicate filtering, annotated synergy_commanders, promotion to minimum examples, and augmentation heuristics (e.g. Counters Matter/Proliferate injection). Includes new scripts (generate_theme_editorial_suggestions, lint, validate, catalog build/apply), updates orchestrator & web routes, expands CI workflow, and documents usage & non-determinism policies. Updates lint rules, type definitions, and docker configs. 2025-09-18 10:59:20 -07:00
augment_theme_yaml_from_catalog.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
autofill_min_examples.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
benchmark_parquet.py feat: migrate to unified Parquet format with instant GitHub setup and 4x faster tagging 2025-10-18 21:32:12 -07:00
build_partner_suggestions.py feat: Added Partners, Backgrounds, and related variation selections to commander building. 2025-10-06 09:17:59 -07:00
build_similarity_cache_parquet.py fix: handle themeTags as list in similarity cache builder 2025-10-18 21:50:12 -07:00
build_theme_catalog.py feature: add non-basic land types to tagging mechanics 2025-10-13 15:07:31 -07:00
cleanup_placeholder_examples.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
enrich_themes.py feat: theme catalog optimization with tag search and faster enrichment 2025-10-15 17:17:46 -07:00
export_themes_to_yaml.py feat: theme catalog optimization with tag search and faster enrichment 2025-10-15 17:17:46 -07:00
extract_themes.py fix: systematically handle numpy arrays from Parquet files across codebase 2025-10-18 22:47:09 -07:00
generate_background_cards.py feat: Added Partners, Backgrounds, and related variation selections to commander building. 2025-10-06 09:17:59 -07:00
generate_theme_catalog.py fix: handle numpy arrays in parse_theme_tags 2025-10-18 22:39:53 -07:00
generate_theme_editorial_suggestions.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
inspect_parquet.py feat: migrate to unified Parquet format with instant GitHub setup and 4x faster tagging 2025-10-18 21:32:12 -07:00
lint_theme_editorial.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
migrate_provenance_to_metadata_info.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
pad_min_examples.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
profile_multi_theme_filter.py feat(random): finalize multi-theme telemetry and polish 2025-09-26 18:15:52 -07:00
purge_anchor_placeholders.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
ratchet_description_thresholds.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
refresh_commander_catalog.py Finalize MDFC follow-ups, docs, and diagnostics tooling 2025-10-02 15:31:05 -07:00
report_editorial_examples.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
report_random_theme_pool.py feat(random): finalize multi-theme telemetry and polish 2025-09-26 18:15:52 -07:00
run_build_with_fallback.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
snapshot_taxonomy.py feat(web): Core Refactor Phase A — extract sampling and cache modules; add adaptive TTL + eviction heuristics, Redis PoC, and metrics wiring. Tests added for TTL, eviction, exports, splash-adaptive, card index, and service worker. Docs+roadmap updated. 2025-09-24 13:57:23 -07:00
synergy_promote_fill.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
theme_example_cards_stats.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
validate_description_mapping.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
validate_theme_catalog.py feat(tagging+archetypes): add Pillowfort/Politics/Midrange/Toolbox tagging and unify archetype presence skip logic 2025-09-19 11:53:52 -07:00
validate_theme_fast_path.py fix: allow empty synergies in fast path validator 2025-09-27 16:17:42 -07:00