Skip to content
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

Merged
merged 3 commits into from
Feb 20, 2025

Conversation

QuanMPhm
Copy link
Contributor

@QuanMPhm QuanMPhm commented Feb 4, 2025

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.

@QuanMPhm QuanMPhm force-pushed the 147/subsidy_nerc_rates branch from 47db22e to 3d6a3ac Compare February 4, 2025 10:19
@joachimweyl
Copy link
Contributor

@QuanMPhm I see there was an update after the review request. Is this ready for review again?

@QuanMPhm
Copy link
Contributor Author

@joachimweyl Yes. I am waiting for at least a review from @naved001 or @knikolla

@naved001 naved001 self-requested a review February 19, 2025 15:37
@@ -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):
Copy link
Collaborator

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.

Copy link
Contributor Author

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.
@QuanMPhm QuanMPhm force-pushed the 147/subsidy_nerc_rates branch from 3d6a3ac to d2e1491 Compare February 20, 2025 18:28
@QuanMPhm QuanMPhm requested a review from naved001 February 20, 2025 18:29
@QuanMPhm QuanMPhm merged commit d6d01cc into CCI-MOC:main Feb 20, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pull subsidy amount from nerc-rates
3 participants