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 thequantitativeboolean flag that dictates output routing.out_dir (path-like) – Directory where
qualitative_ordinances.csvandquantitative_ordinances.csvshould be written. The directory is created bypathlib.Pathif necessary.output_columns (
list) – List of expected output columns (ascompass.plugin.interface.OutputColumninstances) for the consolidated database. The function enforces the presence of these columns in the outputpandas.DataFrame, filling in missing columns with null values as needed.
Notes
Empty DataFrames short-circuit without creating output files. The function respects the boolean
quantitativecolumn and assumes it has already been sanitized bydoc_infos_to_db().