def test_make_2d_no_freq(self): filepath = Path(__file__).parent.parent data_file_path = (filepath / "fixtures" / "data_transforms" / "timeseries_standardized.csv") data = pd.read_csv(data_file_path, index_col=0, parse_dates=True) expected_data_file_path = (filepath / "fixtures" / "data_transforms" / "power_mat.csv") with open(expected_data_file_path) as file: expected_output = np.genfromtxt(file, delimiter=",") key = data.columns[0] actual_output = make_2d(data, key=key, trim_start=True, trim_end=True) np.testing.assert_array_almost_equal(expected_output, actual_output)
def test_make_2d_no_freq(self): data_file_path = os.path.abspath( os.path.join( os.path.dirname(__file__), "../fixtures/data_transforms/timeseries_standardized.csv")) data = pd.read_csv(data_file_path, index_col=0, parse_dates=True) expected_data_file_path = os.path.abspath( os.path.join(os.path.dirname(__file__), "../fixtures/data_transforms/power_mat.csv")) with open(expected_data_file_path) as file: expected_output = np.genfromtxt(file, delimiter=',') key = data.columns[0] actual_output = make_2d(data, key=key, trim_start=True, trim_end=True) np.testing.assert_array_almost_equal(expected_output, actual_output)
def _make_2d_list(self, standardized_data_frame_list): return [make_2d(standardized_data_frame, key='ac_power_01', zero_nighttime=True, interp_missing=True) for standardized_data_frame in standardized_data_frame_list]