Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
a.p.chikov committed Sep 28, 2021
1 parent 90c56ad commit 7c9766e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions etna/transforms/datetime_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def __init__(
week_number_in_year: Optional[bool] = False,
month_number_in_year: Optional[bool] = False,
year_number: Optional[bool] = False,
is_weekend: Optional[bool] = True,
special_days_in_week: Sequence[int] = (),
special_days_in_month: Sequence[int] = (),
is_weekend: Optional[bool] = True,
):
"""Create instance of DateFlags.
Expand All @@ -46,14 +46,14 @@ def __init__(
if True, add column "month_number_in_year" with month info to feature dataframe in transform
year_number:
if True, add column "year_number" with year info to feature dataframe in transform
is_weekend:
if True: add column "regressor_is_weekend" with weekends flags to feature dataframe in transform
special_days_in_week:
list of weekdays number (from [0, 6]) that should be interpreted as special ones, if given add column
"special_days_in_week" with flag that shows given date is a special day
special_days_in_month:
list of days number (from [1, 31]) that should be interpreted as special ones, if given add column
"special_days_in_month" with flag that shows given date is a special day
is_weekend:
if True: add column "regressor_is_weekend" with weekends flags to feature dataframe in transform
Notes
-----
Expand All @@ -79,9 +79,9 @@ def __init__(
week_number_in_year,
month_number_in_year,
year_number,
is_weekend,
special_days_in_week,
special_days_in_month,
is_weekend,
]
):
raise ValueError(
Expand Down
14 changes: 7 additions & 7 deletions tests/test_transforms/test_dateflags_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"week_number_in_year": False,
"week_number_in_month": False,
"month_number_in_year": False,
"special_days_in_week": (),
"special_days_in_month": (),
"year_number": False,
"is_weekend": False,
"special_days_in_week": (),
"special_days_in_month": (),
}


Expand Down Expand Up @@ -95,9 +95,9 @@ def test_invalid_arguments_configuration():
week_number_in_year=False,
month_number_in_year=False,
year_number=False,
is_weekend=False,
special_days_in_week=(),
special_days_in_month=(),
is_weekend=False,
)


Expand All @@ -111,15 +111,15 @@ def test_repr():
week_number_in_year=False,
month_number_in_year=True,
year_number=True,
is_weekend=True,
special_days_in_week=(1, 2),
special_days_in_month=(12,),
is_weekend=True,
)
transform_repr = transform.__repr__()
true_repr = (
f"{transform_class_repr}(day_number_in_week = True, day_number_in_month = True, week_number_in_month = False, "
f"week_number_in_year = False, month_number_in_year = True, year_number = True, special_days_in_week = (1, 2), "
f"special_days_in_month = (12,), is_weekend = True, )"
f"week_number_in_year = False, month_number_in_year = True, year_number = True, is_weekend = True, special_days_in_week = (1, 2), "
f"special_days_in_month = (12,), )"
)
assert transform_repr == true_repr

Expand Down Expand Up @@ -196,9 +196,9 @@ def test_interface_correct_tuple_args(true_params: List[str], train_df: pd.DataF
{"week_number_in_month": True},
{"month_number_in_year": True},
{"year_number": True},
{"is_weekend": True},
{"special_days_in_week": SPECIAL_DAYS},
{"special_days_in_month": SPECIAL_DAYS},
{"is_weekend": True},
),
)
def test_feature_values(
Expand Down

0 comments on commit 7c9766e

Please sign in to comment.