Skip to content

Commit cc798f8

Browse files
committed
Change "H" to "h" for time series frequency
This ensures compatibility with Pandas datetime indexing.
1 parent e0b95b2 commit cc798f8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/pownet/stochastic/solar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def _get_synthetic(self, exog_data: pd.DataFrame, seed: int) -> pd.Series:
157157
start_time = self.data.loc[
158158
(self.data.index.month == month) & (self.data.index.day == day)
159159
].index[0]
160-
end_time = start_time + pd.Timedelta("23H")
160+
end_time = start_time + pd.Timedelta("23h")
161161

162162
# This is the trend + residuals of the STL decomposition
163163
daily_exog_data = None
@@ -180,7 +180,7 @@ def _get_synthetic(self, exog_data: pd.DataFrame, seed: int) -> pd.Series:
180180
daily_y_syn = pd.Series(
181181
daily_y_syn,
182182
name="value",
183-
index=pd.date_range(start_time, end_time, freq="H"),
183+
index=pd.date_range(start_time, end_time, freq="h"),
184184
)
185185
if synthetic_y.empty:
186186
synthetic_y = daily_y_syn

src/pownet/stochastic/timeseries_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def load_data(self, data: pd.DataFrame) -> None:
4545
self.months.sort()
4646
# Time series modeling requires datetime to be the index
4747
self.data = self.data.set_index("datetime")
48-
self.data.index.freq = "H" # Requires hourly time series
48+
self.data.index.freq = "h" # Requires hourly time series
4949
self._is_loaded = True
5050

5151
def fit(

0 commit comments

Comments
 (0)