Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
iKintosh committed May 31, 2022
1 parent 36ce990 commit 91a275e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/test_analysis/test_plotters.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,15 @@ def test_create_holidays_df_as_is(simple_df):
def test_create_holidays_df_non_day_freq():
classic_df = generate_ar_df(periods=30, start_time="2020-01-01", n_segments=1, freq="H")
ts = TSDataset.to_dataset(classic_df)
holidays = pd.DataFrame({"holiday": "Christmas", "ds": pd.to_datetime(["2020-01-01"], ), "upper_window": 3})
holidays = pd.DataFrame(
{
"holiday": "Christmas",
"ds": pd.to_datetime(
["2020-01-01"],
),
"upper_window": 3,
}
)
df = _create_holidays_df(holidays, ts.index, as_is=False)
assert df.sum().sum() == 4

Expand All @@ -288,7 +296,9 @@ def test_create_holidays_df_several_holidays(simple_df):


def test_create_holidays_df_zero_windows(simple_df):
holidays = pd.DataFrame({"holiday": "Christmas", "ds": pd.to_datetime(["2020-01-07"]), "lower_window": 0, "upper_window": 0})
holidays = pd.DataFrame(
{"holiday": "Christmas", "ds": pd.to_datetime(["2020-01-07"]), "lower_window": 0, "upper_window": 0}
)
df = _create_holidays_df(holidays, simple_df.index, as_is=False)
assert df.sum().sum() == 1
assert df.loc["2020-01-07"].sum() == 1
Expand All @@ -304,4 +314,3 @@ def test_create_holidays_df_lower_window_positive(simple_df):
holidays = pd.DataFrame({"holiday": "Christmas", "ds": pd.to_datetime(["2020-01-07"]), "lower_window": 1})
with pytest.raises(ValueError):
_create_holidays_df(holidays, simple_df.index, as_is=False)

0 comments on commit 91a275e

Please sign in to comment.