Skip to content

test: add hydro into mock scenario#73

Merged
BainanXia merged 4 commits intodevelopfrom
update_mock_analyze
Feb 20, 2020
Merged

test: add hydro into mock scenario#73
BainanXia merged 4 commits intodevelopfrom
update_mock_analyze

Conversation

@BainanXia
Copy link
Copy Markdown
Collaborator

@BainanXia BainanXia commented Feb 20, 2020

add 'hydro' into mock_analyze.py
add 'solar' 'wind' and 'hydro' profile tests in test_mocks.py

This PR is just one commit to add hydro into mock scenario object so that 'ScenarioInfo' object could be tested using mock scenario.

add 'hydro' into mock_analyze.py
add 'solar' 'wind' and 'hydro' profile tests in test_mocks.py
Comment thread postreise/tests/mock_analyze.py Outdated

def get_hydro(self):
"""Get hydro.
:return: (pandas.DataFrame) -- dummy wind
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dummy hydro?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I fixed it in the latest commit however it is not published. First time using PyCharm windows, sometimes the latest commit does not go through. I should have checked it before submit the PR. Good catch.

Comment thread postreise/tests/test_mocks.py Outdated
grid_attrs={'plant': mock_plant},
solar=self.mock_solar)
solar = scenario.state.get_solar()
err_msg = 'solar profile should have dimension (periodNum * len(plant))'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

solar/wind/hydro here should not match dimension of plant, they should match dimension of the number of gens of that type within plant. The code looks good, it's just the error message that needs changing.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Same here. I made the changes in the commit that does not go through. It shows up now.

Comment thread postreise/tests/test_mocks.py Outdated
inplace=True)
self.mock_pg.index.name = 'UTC'

solar_plant_id = [plant_id for i, plant_id in enumerate(mock_plant['plant_id']) if mock_plant['type'][i] == 'solar']
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's wrap these lines to get down to 79 chars.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done!

@BainanXia BainanXia merged commit ff5fbb7 into develop Feb 20, 2020
@BainanXia BainanXia deleted the update_mock_analyze branch February 20, 2020 21:29
@ahurli ahurli mentioned this pull request Mar 16, 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