Skip to content

Collaborative addl curtailment#130

Merged
dmuldrew merged 6 commits intodevelopfrom
collaborative_addl_curtailment
Apr 6, 2020
Merged

Collaborative addl curtailment#130
dmuldrew merged 6 commits intodevelopfrom
collaborative_addl_curtailment

Conversation

@dmuldrew
Copy link
Copy Markdown
Collaborator

@dmuldrew dmuldrew commented Apr 3, 2020

Adds the ability to use additional curtailment for the Collaborative Strategy. Moves existing set additional curtailment to the Independent Strategy class.

@dmuldrew dmuldrew added this to the Cherry Blossom milestone Apr 3, 2020
@dmuldrew dmuldrew force-pushed the collaborative_addl_curtailment branch from b694840 to 14ef561 Compare April 3, 2020 23:26
Comment thread powersimdata/scaling/clean_capacity_scaling/auto_capacity_scaling.py Outdated
@danielolsen
Copy link
Copy Markdown
Contributor

danielolsen commented Apr 4, 2020

If this is the same functionality as it was three days ago (i.e., if the interactive rebase and force-push only squashed commits but didn't change the tip of the branch beyond rebasing to develop), then this code has been tested for both Independent and Collaborative scenarios. The old method is disabled for Collaborative, the new method works as expected, and the notebook for Independent still produces identical results.

It would be nice to have a test for this too. I would be happy to add one, since I did that earlier this afternoon so it's still fresh in my head.

@danielolsen
Copy link
Copy Markdown
Contributor

Collaborative tests have been refactored a bit to avoid repeating definitions of the target resources when they're shared across test cases.

Before test refactor:

PS C:\Users\dolsen\repos\iv\PowerSimData> python -m pytest
============================= test session starts =============================
platform win32 -- Python 3.7.4, pytest-5.3.1, py-1.8.0, pluggy-0.13.1
rootdir: C:\Users\dolsen\repos\iv\PowerSimData
collected 93 items

powersimdata\input\tests\test_design_transmission.py ................... [ 20%]
..................                                                       [ 39%]
powersimdata\input\tests\test_grid.py ..............                     [ 54%]
powersimdata\scaling\clean_capacity_scaling\tests\test_object_persistence.py . [ 55%]
..                                                                       [ 58%]
powersimdata\scaling\clean_capacity_scaling\tests\test_resource_target_manager.py . [ 59%]
..............                                                           [ 74%]
powersimdata\scaling\clean_capacity_scaling\tests\test_strategies.py ... [ 77%]
..........                                                               [ 88%]
powersimdata\scaling\clean_capacity_scaling\tests\test_target_manager_input.py . [ 89%]
..                                                                       [ 91%]
powersimdata\scenario\tests\test_scenario_info.py ........               [100%]

============================== warnings summary ===============================
C:\Python37\lib\site-packages\win32\lib\pywintypes.py:2
  C:\Python37\lib\site-packages\win32\lib\pywintypes.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp, sys, os

powersimdata/input/tests/test_grid.py::test_grid_type
  C:\Users\dolsen\repos\iv\PowerSimData\powersimdata\input\grid.py:63: DeprecationWarning: Grid property access is moving to dictionary indexing, i.e. grid['branch'] consistent with REISE.jl
    DeprecationWarning

-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 93 passed, 2 warnings in 4.95s ========================

After test refactor:

PS C:\Users\dolsen\repos\iv\PowerSimData> python -m pytest
============================= test session starts =============================
platform win32 -- Python 3.7.4, pytest-5.3.1, py-1.8.0, pluggy-0.13.1
rootdir: C:\Users\dolsen\repos\iv\PowerSimData
collected 93 items

powersimdata\input\tests\test_design_transmission.py ................... [ 20%]
..................                                                       [ 39%]
powersimdata\input\tests\test_grid.py ..............                     [ 54%]
powersimdata\scaling\clean_capacity_scaling\tests\test_object_persistence.py . [ 55%]
..                                                                       [ 58%]
powersimdata\scaling\clean_capacity_scaling\tests\test_resource_target_manager.py . [ 59%]
..............                                                           [ 74%]
powersimdata\scaling\clean_capacity_scaling\tests\test_strategies.py ... [ 77%]
..........                                                               [ 88%]
powersimdata\scaling\clean_capacity_scaling\tests\test_target_manager_input.py . [ 89%]
..                                                                       [ 91%]
powersimdata\scenario\tests\test_scenario_info.py ........               [100%]

============================== warnings summary ===============================
C:\Python37\lib\site-packages\win32\lib\pywintypes.py:2
  C:\Python37\lib\site-packages\win32\lib\pywintypes.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp, sys, os

powersimdata/input/tests/test_grid.py::test_grid_type
  C:\Users\dolsen\repos\iv\PowerSimData\powersimdata\input\grid.py:63: DeprecationWarning: Grid property access is moving to dictionary indexing, i.e. grid['branch'] consistent with REISE.jl
    DeprecationWarning

-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 93 passed, 2 warnings in 4.72s ========================

Adding a new test case test_collaborative_capacity_strategy_collab_curtailment() to ensure that collaborative curtailment works as expected (the same test case that was given as 'System 4' in the excel file):

PS C:\Users\dolsen\repos\iv\PowerSimData> python -m pytest
============================= test session starts =============================
platform win32 -- Python 3.7.4, pytest-5.3.1, py-1.8.0, pluggy-0.13.1
rootdir: C:\Users\dolsen\repos\iv\PowerSimData
collected 94 items

powersimdata\input\tests\test_design_transmission.py ................... [ 20%]
..................                                                       [ 39%]
powersimdata\input\tests\test_grid.py ..............                     [ 54%]
powersimdata\scaling\clean_capacity_scaling\tests\test_object_persistence.py . [ 55%]
..                                                                       [ 57%]
powersimdata\scaling\clean_capacity_scaling\tests\test_resource_target_manager.py . [ 58%]
..............                                                           [ 73%]
powersimdata\scaling\clean_capacity_scaling\tests\test_strategies.py ... [ 76%]
...........                                                              [ 88%]
powersimdata\scaling\clean_capacity_scaling\tests\test_target_manager_input.py . [ 89%]
..                                                                       [ 91%]
powersimdata\scenario\tests\test_scenario_info.py ........               [100%]

============================== warnings summary ===============================
C:\Python37\lib\site-packages\win32\lib\pywintypes.py:2
  C:\Python37\lib\site-packages\win32\lib\pywintypes.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp, sys, os

powersimdata/input/tests/test_grid.py::test_grid_type
  C:\Users\dolsen\repos\iv\PowerSimData\powersimdata\input\grid.py:63: DeprecationWarning: Grid property access is moving to dictionary indexing, i.e. grid['branch'] consistent with REISE.jl
    DeprecationWarning

-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 94 passed, 2 warnings in 4.77s ========================

Copy link
Copy Markdown
Contributor

@danielolsen danielolsen left a comment

Choose a reason for hiding this comment

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

This looks good, thanks!

I made a few changes of my own, so someone should probably review those before this gets merged in.

@dmuldrew dmuldrew merged commit d73afdc into develop Apr 6, 2020
@danielolsen danielolsen deleted the collaborative_addl_curtailment branch April 7, 2020 18:52
@ahurli ahurli mentioned this pull request Mar 11, 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