Skip to content

Commit

Permalink
fix: use list instead of set to create column names in data frame
Browse files Browse the repository at this point in the history
  • Loading branch information
rouille committed Nov 2, 2022
1 parent b4373b4 commit b77b3ed
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions powersimdata/tests/mock_profile_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@


class MockProfileInput:
"""
MockInputData is a mock of powersimdata.input.profile_input.ProfileInput
"""MockInputData is a mock of powersimdata.input.profile_input.ProfileInput
that generates random profiles.
Exactly 3 of {`start_time`, `end_time`, `periods`, `freq`} must be specified. See <https://pandas.pydata.org/docs/reference/api/pandas.date_range.html>.
Exactly 3 of {`start_time`, `end_time`, `periods`, `freq`} must be specified. See
<https://pandas.pydata.org/docs/reference/api/pandas.date_range.html>.
:param powersimdata.input.grid.Grid grid: instance of Grid object.
:param str start_time: when profiles begin.
:param str end_time: when profiles end.
:param int periods: number of times in profile.
:param str freq: frequency of times in profile.
:param int random_seed: used to initialize the random generator.
:raises ValueError: raised if `field_name` specified in `get_data()` is not specified by this mock
:raises ValueError: raised if `field_name` specified in `get_data()` is not
specified by this mock
:return: (*powersimdata.tests.mock_profile_input.MockProfileInput*)
"""

Expand Down Expand Up @@ -72,7 +73,7 @@ def _get_demand(self):
:return: (*pandas.DataFrame*) -- fake demand data
"""
zone_ids = set(self._grid.plant["zone_id"])
zone_ids = self._grid.plant["zone_id"].unique()
fake_demand_profile = self._create_fake_profile(zone_ids)
return fake_demand_profile

Expand All @@ -81,7 +82,7 @@ def _get_demand_flexibility(self):
:return: (*dict*) -- dictionary of fake flexibile demand data
"""
zone_ids = set(self._grid.plant["zone_id"])
zone_ids = self._grid.plant["zone_id"].unique()
demand_flexibility_profile_types = [
"demand_flexibility_up",
"demand_flexibility_dn",
Expand Down

0 comments on commit b77b3ed

Please sign in to comment.