compass.utilities.finalize.save_run_meta#

save_run_meta(dirs, tech, start_date, end_date, num_jurisdictions_searched, num_jurisdictions_found, total_cost, models)[source]#

Persist metadata describing an ordinance collection run

Parameters:
  • dirs (compass.utilities.base.Directories) – Directory container describing where outputs, logs, and working files should be written during the run.

  • tech ({"wind", "solar", "small wind"}) – Technology targeted by the collection run. The value is stored verbatim in the metadata file for downstream reporting.

  • start_date (datetime.datetime) – Timestamp marking when the run began.

  • end_date (datetime.datetime) – Timestamp marking when the run finished.

  • num_jurisdictions_searched (int) – Number of jurisdictions evaluated during the run.

  • num_jurisdictions_found (int) – Number of jurisdictions that produced at least one ordinance.

  • total_cost (float) – Aggregate cost incurred by LLM usage for the run. None or zero values are recorded as null in the metadata.

  • models (dict) – Mapping from LLM task identifiers (as str) to configuration objects (OpenAIConfig) used throughout the run. The function records a condensed summary of each configuration.

Returns:

float – Total runtime of the collection, expressed in seconds.

Notes

The function writes meta.json into dirs.out alongside references to other artifacts generated during the run. The return value mirrors the total_time entry stored in the metadata.