Skip to content

Commit e774581

Browse files
committed
Added include_in_NERC_total_invoice field to institute_list.yaml
The means the `INCLUDED_INSTITUTIONS` from `NERCTotalInvoice` is now removed.
1 parent 5c7290d commit e774581

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

process_report/institute_list.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
domains:
77
- bu.edu
88
mghpcc_partnership_start_date: "2013-06"
9+
include_in_NERC_total_invoice: True
910
- display_name: Bentley
1011
domains:
1112
- bentley.edu
1213
- display_name: University of Rhode Island
1314
domains:
1415
- uri.edu
16+
include_in_NERC_total_invoice: True
1517
- display_name: Red Hat
1618
domains:
1719
- redhat.com
@@ -38,6 +40,7 @@
3840
- harvard.edu
3941
- chemistry.harvard.edu
4042
mghpcc_partnership_start_date: "2013-06"
43+
include_in_NERC_total_invoice: True
4144
- display_name: Worcester Polytechnic Institute
4245
domains:
4346
- wpi.edu

process_report/invoices/NERC_total_invoice.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ class NERCTotalInvoice(invoice.Invoice):
1212
- NewPICreditProcessor
1313
"""
1414

15-
INCLUDED_INSTITUTIONS = [
16-
"Harvard University",
17-
"Boston University",
18-
"University of Rhode Island",
19-
]
20-
2115
export_columns_list = [
2216
invoice.INVOICE_DATE_FIELD,
2317
invoice.PROJECT_FIELD,
@@ -51,9 +45,15 @@ def output_s3_archive_key(self):
5145
return f"Invoices/{self.invoice_month}/Archive/NERC-{self.invoice_month}-Total-Invoice {util.get_iso8601_time()}.csv"
5246

5347
def _prepare_export(self):
48+
included_institutions = list()
49+
institute_list = util.load_institute_list()
50+
for institute_info in institute_list:
51+
if institute_info.get("include_in_NERC_total_invoice"):
52+
included_institutions.append(institute_info["display_name"])
53+
5454
self.export_data = self.data[
5555
self.data[invoice.IS_BILLABLE_FIELD] & ~self.data[invoice.MISSING_PI_FIELD]
5656
]
5757
self.export_data = self.export_data[
58-
self.export_data[invoice.INSTITUTION_FIELD].isin(self.INCLUDED_INSTITUTIONS)
58+
self.export_data[invoice.INSTITUTION_FIELD].isin(included_institutions)
5959
].copy()

0 commit comments

Comments
 (0)