IO¶
Config Loading¶
policy_arena.io.config_loader
¶
Load scenario configuration from YAML and build Scenario objects.
load_config(path)
¶
Load and validate a YAML config file.
Source code in src/policy_arena/io/config_loader.py
77 78 79 80 81 82 83 | |
load_scenario(path)
¶
Load a YAML config and build a ready-to-run Scenario.
Source code in src/policy_arena/io/config_loader.py
86 87 88 89 | |
build_scenario(config)
¶
Build a Scenario from a validated ScenarioConfig.
Source code in src/policy_arena/io/config_loader.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
Schemas¶
policy_arena.io.schemas
¶
Results Writer¶
policy_arena.io.results_writer
¶
Write simulation results to Parquet files via polars.
write_results(results, config=None, output_dir=None, run_id=None)
¶
Write simulation results to Parquet files.
Creates a directory structure: {output_dir}/{run_id}/ rounds.parquet — per-agent per-round data metrics.parquet — model-level metrics per round run_metadata.json — config snapshot + timing
Returns the run directory path.
Source code in src/policy_arena/io/results_writer.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
Results Reader¶
policy_arena.io.results_reader
¶
Read simulation results from Parquet files.
StoredResults(run_id, rounds=None, metrics=None, metadata=dict())
dataclass
¶
Results loaded from disk.
read_results(run_dir)
¶
Read simulation results from a run directory.
Source code in src/policy_arena/io/results_reader.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
list_runs(results_dir='results')
¶
List all run IDs in the results directory.
Source code in src/policy_arena/io/results_reader.py
56 57 58 59 60 61 62 63 64 65 | |