CCI-MOC / process_csv_report

Some scripts to help process our billing reports
0 stars 3 forks source link

Allow limiting New-PI credit to partner institutions #96

Closed QuanMPhm closed 1 month ago

QuanMPhm commented 2 months ago

Closes #94, process_report.py will now use nerc_rates to determine if the New-PI credit is limited to institutions that are MGHPCC partners for the given invoice month.

The script determines whether an institution's MGHPCC partnership is active by first seeing if the mghpcc_partnership_start_date field is set in institute_list.yaml, then checks if the start date is within or before the invoice month.

@joachimweyl To mark an institution as an MGHPCC partner, you will need to set the field mghpcc_partnership_start_date in institute_list.yaml to the start date of the partnership in YYYY-MM format.

I.e for Boston University, their current entry looks like this:

-   display_name: Boston University
    domains:
    - bu.edu
    - robbaron

To mark them as a partner, change their entry like so:

-   display_name: Boston University
    domains:
    - bu.edu
    - robbaron
    mghpcc_partnership_start_date: "2024-10"
QuanMPhm commented 1 month ago

@naved001 During the first refactor PR (#54) when the Invoice class was created, I moved get_institution_from_pi and `load_institute_list toutils.pybut forgot to remove the functionsprocess_report.py`, and also forgot to update the references to the function.

Functionally, this didn't change anything. Stylistically, it wasn't a big deal until this PR, since more references to these functions were added. While writing this PR, I just decided the two functions should be placed in utils.py, and so did the cleanup that I forgot to do when I made the initial refactor PR.

naved001 commented 1 month ago

While writing this PR, I just decided the two functions should be placed in utils.py,

In the future I'd recommend separate commits for tangentially related cleanups.