Filter out Max Raid den routes from Sword/Shield game data
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:
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user