-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The BU subsidy and New-PI credit can now be fetched from nerc_rates #148
Conversation
47db22e
to
3d6a3ac
Compare
@QuanMPhm I see there was an update after the review request. Is this ready for review again? |
@joachimweyl Yes. I am waiting for at least a review from @naved001 or @knikolla |
process_report/util.py
Outdated
@@ -90,3 +92,8 @@ def fetch_s3(s3_filepath): | |||
invoice_bucket = get_invoice_bucket() | |||
invoice_bucket.download_file(s3_filepath, local_name) | |||
return local_name | |||
|
|||
|
|||
def fetch_nerc_rates(metadata_name, invoice_month): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a good reason to have this function and unnecessarily bloat util.py. Just move rates_info = load_from_url()
to the top of processor_report.py
, and then just query the rate as needed instead of this function call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have created a global rates_info
in process_report.py
The user now has the option to provide a custom subsidy amount, or to fetch from nerc_rates. A `fetch_nerc_rates` function has been added to `utils.py`, as it is now commonly used.
3d6a3ac
to
d2e1491
Compare
Closes #147. In addition to fetching the BU subsidy, I decided to also fetch the New-PI credit. These values can optionally be provided through the CLI.
Also, some if-clauses have been refactored for cleanliness.