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

feat: calculate change table MW-miles with tests and mocks #67

Closed
wants to merge 1 commit into from

Conversation

danielolsen
Copy link
Contributor

This branch adds a method to the Analyze object to calculate the aggregate MW-miles of upgrades from a given change_table. A new folder tests/ is created with a new file mocks.py for common testing (copied from PostREISE) and a test script test_calculate_mw_miles.py to test returns from the new function for data structure and proper values.

@rouille
Copy link
Collaborator

rouille commented Oct 30, 2019

Is there any reason why it is not in postreise/analyze?

@danielolsen
Copy link
Contributor Author

danielolsen commented Oct 30, 2019

@rouille to calculate the difference between the scaled capacity and the new capacity, we need to be able to access the original capacity, and the only place I saw that ability was a hidden attribute in the grid object (._original_grid). So I figured if we're accessing this, I figured we should access it from the same package as we define the Grid object. I'm agnostic to where this code lives though, if you think it's better to have it in postreise I'll put it there instead.

@rouille
Copy link
Collaborator

rouille commented Oct 30, 2019

Yes I have seen. It does not feel right to include the analysis there. I would rather pass a scenario instance to your function and:

  • use get_ct() to get the change table
  • get original grid as follows: original_grid = Grid(s.info['interconnect'].split('_')). You will need to import the Grid object
    How does it sound?

@danielolsen
Copy link
Contributor Author

danielolsen commented Oct 30, 2019

I am okay with your approach. I'll close this PR and make another one with the revised function in postreise/analysis.

EDIT: See new PR here: Breakthrough-Energy/PostREISE#41

@danielolsen danielolsen deleted the calc_mw_miles branch January 9, 2020 00:10
@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.

2 participants