Merged in feature/script-add-lesser-of-id-to-testbed (pull request #603)

Add script to generate and save reimbursement IDs in testbed

* Add script to generate and save reimbursement IDs in testbed

* Merged main into feature/script-add-lesser-of-id-to-testbed


Approved-by: Katon Minhas
This commit is contained in:
Alex Galarce
2025-07-08 17:19:34 +00:00
parent 479675b05c
commit da362dcedb
@@ -0,0 +1,23 @@
"""This script reads the testbed file, generates reimbursement IDs,
and saves the updated testbed with the new IDs.
It should be run from the `fieldExtraction` directory, with the testbed file co-located in the same directory.
The output will be saved as `Doczy-Testbed-with-Reimb-IDs.xlsx`.
Run it with `poetry run python -m src.testbed.add_reimb_id_to_testbed`
"""
# Imports
import pandas as pd
from src.postprocessing_funcs import generate_reimb_ids
from src.constants.investment_columns import COLUMN_ORDER
from src.investment.investment_postprocessing_funcs import reorder_columns
# Read the testbed file
testbed = pd.read_excel("Doczy-Testbed.xlsx")
# Generate reimbursement IDs and reorder columns
testbed_w_ids = reorder_columns(generate_reimb_ids(testbed), COLUMN_ORDER)
# Save the updated testbed with reimbursement IDs
testbed_w_ids.to_excel("Doczy-Testbed-with-Reimb-IDs.xlsx", index=False)