Skip to content

Commit

Permalink
Fixed code for flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Michail Bugaev authored and gerrymanoim committed Feb 29, 2024
1 parent f7940e3 commit 5a53d8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions exchange_calendars/exchange_calendar_xmos.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from .exchange_calendar import WEEKDAYS, HolidayCalendar, ExchangeCalendar
from .pandas_extensions.offsets import MultipleWeekmaskCustomBusinessDay


def new_years_eve_observance(dt: datetime.datetime) -> datetime.datetime | None:
# For some reason New Year's Eve was not a holiday these years.
return None if dt.year in [2008, 2009] else weekend_to_monday(dt)
Expand Down Expand Up @@ -295,8 +296,8 @@ def special_weekmasks(self):
weekmasks that applies between dates.
"""
return [
# For 1999-2011 years next url was used to obtain data for
# IMOEX close values in order to check if there are any Sat or Sun:
# For 1999-2011 years next url was used to obtain data for
# IMOEX close values in order to check if there are any Sat or Sun:
# https://iss.moex.com/iss/history/engines/stock/markets/index/securities/IMOEX
(pd.Timestamp("1999-01-04"), pd.Timestamp("1999-01-10"), "1111101"),
(pd.Timestamp("2000-05-01"), pd.Timestamp("2000-05-07"), "1111110"),
Expand Down Expand Up @@ -325,7 +326,7 @@ def special_weekmasks(self):
(pd.Timestamp("2010-02-22"), pd.Timestamp("2010-02-28"), "1111110"),
(pd.Timestamp("2010-11-08"), pd.Timestamp("2010-11-14"), "1111110"),
(pd.Timestamp("2011-02-28"), pd.Timestamp("2011-03-06"), "1111110"),
# For 2012 year https://www.moex.com/a254
# For 2012 year https://www.moex.com/a254
(pd.Timestamp("2012-03-05"), pd.Timestamp("2012-03-11"), "1111101"),
(pd.Timestamp("2012-04-23"), pd.Timestamp("2012-05-13"), "1111110"),
(pd.Timestamp("2012-06-04"), pd.Timestamp("2012-06-10"), "1111110"),
Expand Down
2 changes: 1 addition & 1 deletion exchange_calendars/pandas_extensions/offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def business_days(self, business_days):
for left, right in toolz.sliding_window(
2, toolz.concatv(self._business_days_index)
):
if pd.Timestamp((right.left - left.right).days,
if pd.Timestamp((right.left - left.right).days,
unit="D") > pd.Timestamp(1, unit="D"):
interval = pd.Interval(
left.right + pd.Timedelta(1, unit="D"),
Expand Down

0 comments on commit 5a53d8a

Please sign in to comment.