compass.utilities.finalize.save_db#

save_db(db, out_dir, output_columns)[source]#

Write qualitative and quantitative ordinance outputs to disk

Parameters:
  • db (pandas.DataFrame) – Ordinance dataset containing the full set of output columns, plus the quantitative boolean flag that dictates output routing.

  • out_dir (path-like) – Directory where qualitative_ordinances.csv and quantitative_ordinances.csv should be written. The directory is created by pathlib.Path if necessary.

  • output_columns (list) – List of expected output columns (as compass.plugin.interface.OutputColumn instances) for the consolidated database. The function enforces the presence of these columns in the output pandas.DataFrame, filling in missing columns with null values as needed.

Notes

Empty DataFrames short-circuit without creating output files. The function respects the boolean quantitative column and assumes it has already been sanitized by doc_infos_to_db().