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

Gb/rrp shapes #93

Merged
merged 8 commits into from
Mar 3, 2021
Merged

Gb/rrp shapes #93

merged 8 commits into from
Mar 3, 2021

Conversation

grantbuster
Copy link
Member

No description provided.

@grantbuster
Copy link
Member Author

grantbuster commented Mar 2, 2021

Here's the plot produced by the rev-reeds-plexos test with the shape file definition of the "plexos nodes". Each shape will aggregate all resident supply curve points (the x's) with respective capacities requested by reeds. This example results in 2 output power profiles.

test_rev_reeds_plexos_shape

@MRossol
Copy link
Collaborator

MRossol commented Mar 2, 2021

Cool!

@MRossol MRossol self-requested a review March 3, 2021 15:07
Copy link
Collaborator

@MRossol MRossol left a comment

Choose a reason for hiding this comment

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

Are you still planning on making a basic plant aggregator or do you want me to do that as a parent class for PlexosPlants? I feel like it would be useful, but its still unclear how applicable it is for this workflow.

from warnings import warn

from rex.rechunk_h5 import to_records_array
from rex.utilities.execution import SpawnProcessPool
from rex.utilities.utilities import parse_table

from reVX.utilities.region import RegionClassifier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Silly i know but I think we should rename the module region_classifier

Copy link
Member Author

Choose a reason for hiding this comment

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

like the file? yes, agreed!

force_full_build : bool
Flag to ensure the full requested buildout is built at each SC
point. If True, the remainder of the requested build will always
be built at the last resource gid in the sc point.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have a check for the 1e6 hack? I.e. what if the requested build is > the capacity of the last resource gid? Do we just multiply the cf of the last resource gid by the requested capacity?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah this flag turns on the 1e6 hack and i added a negative test with the flag=false to ensure that it will fail if the requested build > available capacity within one watt. If this flag is true, the last GID in the supply curve point is given a 1e6MW capacity ("the remainder of the requested build will always be built at the last resource gid in the sc point")

plexos_nodes = parse_table(plexos_nodes)
plexos_nodes = DataCleaner.pre_filter_plexos_meta(plexos_nodes)

if (isinstance(plexos_nodes, str)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not add a sub if/else under isisnstance(plexos_nodes, str)?

Copy link
Member Author

Choose a reason for hiding this comment

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

same effect isnt it? And adds "complexity" in the form of more levels. Bad incentives by pylint!!

and plexos_nodes.endswith(('.csv', '.json'))):
plexos_nodes = parse_table(plexos_nodes)
elif isinstance(plexos_nodes, str) and plexos_nodes.endswith('.shp'):
rc = RegionClassifier(self.sc_build, plexos_nodes,
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we want to un-hide RegionsClassifier._regions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah i'll add a property

plexos_nodes['plexos_id'] = np.arange(len(plexos_nodes))

elif not isinstance(plexos_nodes, pd.DataFrame):
msg = ('Did not recognize plexos_nodes input: {}'
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should make the error message more specific, i.e. expecting x, y, or z, but got:

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep can do!

@codecov-io
Copy link

codecov-io commented Mar 3, 2021

Codecov Report

Merging #93 (dc9817d) into master (4a1643a) will increase coverage by 0.12%.
The diff coverage is 85.03%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #93      +/-   ##
==========================================
+ Coverage   78.85%   78.97%   +0.12%     
==========================================
  Files          68       67       -1     
  Lines        7253     7368     +115     
==========================================
+ Hits         5719     5819     +100     
- Misses       1534     1549      +15     
Flag Coverage Δ
unittests 78.97% <85.03%> (+0.12%) ⬆️

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

Impacted Files Coverage Δ
reVX/plexos/rev_reeds_plexos_cli.py 52.52% <50.00%> (-0.97%) ⬇️
tests/test_rev_reeds_plexos.py 83.82% <79.77%> (-8.49%) ⬇️
reVX/plexos/rev_reeds_plexos.py 84.09% <88.28%> (+2.06%) ⬆️
reVX/utilities/region_classifier.py 74.62% <94.73%> (ø)
reVX/cli.py 87.77% <100.00%> (ø)
reVX/plexos/utilities.py 86.06% <100.00%> (+0.17%) ⬆️
reVX/utilities/__init__.py 100.00% <100.00%> (ø)
reVX/version.py 100.00% <100.00%> (ø)
tests/test_plexos_data_utilities.py 94.64% <100.00%> (+0.04%) ⬆️
tests/test_plexos_node.py 95.58% <100.00%> (ø)
... and 6 more

@grantbuster grantbuster merged commit 3f02992 into master Mar 3, 2021
@grantbuster grantbuster deleted the gb/rrp_shapes branch March 3, 2021 19:43
github-actions bot pushed a commit that referenced this pull request Mar 3, 2021
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.

3 participants