Filter out Max Raid den routes from Sword/Shield game data
All checks were successful
CI / backend-lint (pull_request) Successful in 8s
CI / frontend-lint (pull_request) Successful in 29s

Den child routes (~561 per game) bloated the route list without being
useful for Nuzlocke tracking. Adds filter_den_routes() to strip children
matching "(Den " from the route hierarchy, reducing Sw/Sh from ~1,007
to 446 routes each.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Julian Tabel
2026-02-13 09:18:29 +01:00
parent 659dcf2252
commit b7be099aee
5 changed files with 862 additions and 97067 deletions

View File

@@ -19,7 +19,7 @@ from pathlib import Path
from .loader import load_pokedb_data, load_seed_config
from .mappings import PokemonMapper, LocationMapper, build_version_map, map_encounter_method
from .output import sort_routes, merge_special_encounters, write_game_json, write_games_json, write_pokemon_json
from .processing import filter_encounters_for_game, process_encounters, build_routes
from .processing import filter_encounters_for_game, process_encounters, build_routes, filter_den_routes
from .sprites import download_all_sprites, download_sprites
SEEDS_DIR_CANDIDATES = [
@@ -200,6 +200,10 @@ def main(argv: list[str] | None = None) -> None:
# Build route hierarchy
routes = build_routes(encounters_by_area, location_mapper)
# Filter out Max Raid den child routes (Sword/Shield only)
if vg_key == "sword-shield":
routes = filter_den_routes(routes)
# Merge special encounters (starters, gifts, fossils)
routes = merge_special_encounters(routes, config, vg_key, pokemon_mapper)

View File

@@ -341,3 +341,15 @@ def build_routes(
))
return routes
def filter_den_routes(routes: list[Route]) -> list[Route]:
"""Remove Max Raid den child routes from the route list.
Dens are identified by "(Den " in the child route name.
Only children are filtered — parent routes are kept.
"""
for route in routes:
if route.children:
route.children = [c for c in route.children if "(Den " not in c.name]
return routes