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

Supply Curve Aggregation by Zone within GIDs #503

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Conversation

mjgleason
Copy link
Collaborator

@mjgleason mjgleason commented Jan 16, 2025

First cut at implementing supply curve aggregation for zones within GIDs. This functionality is enable by passing values to the new zones_dset argument.

I added new tests to tests/test_supply_curve_sc_aggregation.py, and the existing tests are all passing as well. I was unable to directly test that this functionality works with cap_cost_scale because the test gen/econ datasets do not have the correctly named economic datasets, but I did test that each zone + sc site is output to a separate sc_gid with the correct areas and capacities. Since the capital cost scale functionality is already tested separately, and runs downstream of the area and capacity calculations for each site in GenerationSupplyCurvePoint.summarize(), I don't this its okay not to test it.

This PR also includes some incidental changes to .pylintrc and .pre-commit-config.yaml to get them working again (they were pretty outdated).

@mjgleason mjgleason requested a review from ppinchuk January 16, 2025 20:37
@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 95.71429% with 6 lines in your changes missing coverage. Please review.

Project coverage is 87.75%. Comparing base (eb62992) to head (ab34681).

Files with missing lines Patch % Lines
reV/supply_curve/aggregation.py 76.92% 3 Missing ⚠️
tests/test_supply_curve_sc_aggregation.py 96.90% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #503      +/-   ##
==========================================
+ Coverage   87.61%   87.75%   +0.14%     
==========================================
  Files         121      121              
  Lines       18390    18536     +146     
==========================================
+ Hits        16112    16267     +155     
+ Misses       2278     2269       -9     
Flag Coverage Δ
unittests 87.75% <95.71%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@ppinchuk ppinchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving comments here now so that I don't forget them over the weekend

@mjgleason mjgleason marked this pull request as ready for review January 21, 2025 18:28
ppinchuk

This comment was marked as duplicate.

@ppinchuk ppinchuk added enhancement Update to logic or general code improvements p-medium Priority: medium new computation Update that adds a new computation method topic-aggregation Issues/pull requests related to supply curve aggregation labels Mar 20, 2025
Copy link
Collaborator

@ppinchuk ppinchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome, thank you! Couple of quick questions and then I think we can get this merged!

assert zone_mask.shape[0] <= resolution, msg
assert zone_mask.shape[1] <= resolution, msg
assert zone_mask.size == len(self._gids), msg
self._zone_mask = zone_mask.copy()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This copy seems to be intentionally placed, but I can't seem to figure out why. Do you ever modify the values within? Did you run into some sort of issues without the copy? or is this just trying to be future-proof?

Comment on lines +744 to +746
# each entire cell is one zone
for gid, gid_slice in slice_lookup.items():
data[gid_slice] = gid + 10
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth having a separate test with multiple zones per SC point? Just to make sure we get repeated sc_point_gid outputs with different zone ID's? Or is that too cumbersome to set up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Update to logic or general code improvements new computation Update that adds a new computation method p-medium Priority: medium topic-aggregation Issues/pull requests related to supply curve aggregation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants