From b77b3ed12724228f52fad13236ece8c764de95a0 Mon Sep 17 00:00:00 2001 From: Ben RdO Date: Tue, 1 Nov 2022 23:02:25 -0700 Subject: [PATCH] fix: use list instead of set to create column names in data frame --- powersimdata/tests/mock_profile_input.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/powersimdata/tests/mock_profile_input.py b/powersimdata/tests/mock_profile_input.py index 83af53c6e..096d83d4d 100644 --- a/powersimdata/tests/mock_profile_input.py +++ b/powersimdata/tests/mock_profile_input.py @@ -5,11 +5,11 @@ 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 . + Exactly 3 of {`start_time`, `end_time`, `periods`, `freq`} must be specified. See + . :param powersimdata.input.grid.Grid grid: instance of Grid object. :param str start_time: when profiles begin. @@ -17,7 +17,8 @@ class MockProfileInput: :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*) """ @@ -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 @@ -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",