Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvonk committed Mar 12, 2024
1 parent c3a9f39 commit 68d73da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/spei/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def compute_cdf_rolling_window(

if window < 3:
logging.error("Window should be larger than 2. Setting the window value to 3.")
window = 3 # make sure window is at least three (value itself plus one to the left and right)
window = 3 # make sure window is at least three
elif window % 2 == 0:
logging.error(f"Window should be odd. Setting the window value to {window + 1}")
window += 1 # make sure window is odd
Expand Down
8 changes: 6 additions & 2 deletions src/spei/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def infer_frequency(index: Union[Index, DatetimeIndex]) -> str:


def group_yearly_df(series: Series) -> DataFrame:
"""Group series in a DataFrame with date (in the year 2000) as index and year as columns."""
"""Group series in a DataFrame with date (in the year 2000) as index and
year as columns.
"""
strfstr: str = "%m-%d %H:%M:%S"
grs = {}
freq = "YE" if pd_version >= "2.1.0" else "Y"
Expand Down Expand Up @@ -112,7 +114,9 @@ def get_data_series(group_df: DataFrame) -> Series:


def daily_window_groupby_yearly_df(dfval: DataFrame, period: int) -> DataFrame:
"""Fill a period of daily values in grouped by yearly DataFrame to get cyclic rolling window."""
"""Fill a period of daily values in grouped by yearly DataFrame to get
cyclic rolling window.
"""
dfval_window_index_start = [
dfval.index[0] + Timedelta(value=-i, unit="D")
for i in reversed(range(1, period))
Expand Down

0 comments on commit 68d73da

Please sign in to comment.