INNER CODE UNIT · Python
_seed_leaders
cmu-sei/GHOSTS · experimental/grms/grms/main.py:61
def _seed_leaders():
"""Load leader profiles from seed data on startup."""
seed_dir = Path(__file__).parent / "data" / "sample_leaders"
if not seed_dir.exists():
return
for filepath in sorted(seed_dir.glob("*.json")):
if filepath.name in ("g20_scenario.json", "sample_leader.json", "sample_population.json"):
continue
try:
data = json.loads(filepath.read_text())
profile = LeaderProfile(**data)
leaders[profile.id] = profile
logger.info("Seeded leader: %s (%s)", profile.name, profile.country)
except Exception as e:
logger.warning("Failed to load %s: %s", filepath.name, e)
logger.info("Seeded %d leaders on startup", len(leaders))