Skip to content

Commit

Permalink
Fmt chgs black 23.1
Browse files Browse the repository at this point in the history
  • Loading branch information
maread99 committed Feb 20, 2023
1 parent f04d2ea commit 3aacd17
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 13 deletions.
3 changes: 0 additions & 3 deletions src/market_prices/daterange.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ def _daterange_is_monthly(self) -> tuple[mptypes.DateRangeReq, pd.Timestamp]:
(start, end), end_accuracy = self._get_start_end()

if self._has_duration:

if end == self.end_now[0]:
# evaluate duration from period end, i.e. right of last indice.
# end will be reset to now after evaluating start.
Expand Down Expand Up @@ -514,7 +513,6 @@ def daterange(self) -> tuple[mptypes.DateRangeReq, pd.Timestamp]:
(start, end), end_accuracy = self._get_start_end()

if self._has_duration:

if self.pp["days"] > 0:
days = self.pp["days"]
if start is None:
Expand Down Expand Up @@ -998,7 +996,6 @@ def daterange(self) -> tuple[mptypes.DateRange, pd.Timestamp]:
(start, end), end_accuracy = self._get_start_end(hard_strict=hard_strict)

if self._has_duration:

intraday_duration = self.pp["hours"] * 60 + self.pp["minutes"]
if intraday_duration:
if intraday_duration < self.final_interval.as_minutes:
Expand Down
1 change: 0 additions & 1 deletion src/market_prices/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,6 @@ class CompositeIndexCalendarConflict(MarketPricesError):
"""Indices of a composite calendar conflict with other indices of same calendar."""

def __init__(self, calendar: ExchangeCalendar):

self._msg = (
"Unable to create a composite trading index as indices of calendar"
f" '{calendar.name}' would overlap. This can occur when the interval is"
Expand Down
1 change: 0 additions & 1 deletion src/market_prices/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ def _parse_start_end(
# Check start isn't later than latest date/time for which prices available.
# Has side-effect of ensuring `start` is to the left of right calendar bound.
if start is not None:

if start_is_date:
mrs = _mr_session(cal, delay)
if start > mrs:
Expand Down
1 change: 1 addition & 0 deletions src/market_prices/prices/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2360,6 +2360,7 @@ def pp(self, intraday: bool) -> mptypes.PP:
@property
def intraday_limit(self) -> Callable[[intervals.BI], pd.Timestamp]:
"""Earliest minute for which intraday data can be requested."""

# pylint: disable=protected-access
def limit(bi: BI) -> pd.Timestamp:
l_limit, _ = self.prices.limits[bi]
Expand Down
6 changes: 3 additions & 3 deletions tests/hypstrtgy.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,8 @@ def base_intervals() -> st.SearchStrategy[TDInterval]:
return st.sampled_from(conftest.base_intervals_sample)


def base_ds_intervals() -> st.SearchStrategy[
tuple[TDInterval, TDInterval | None, TDInterval]
]:
def base_ds_intervals() -> (
st.SearchStrategy[tuple[TDInterval, TDInterval | None, TDInterval]]
):
"""Return strategy for a sample base interval and valid ds_intervals."""
return st.sampled_from(conftest.base_ds_intervals_list)
9 changes: 6 additions & 3 deletions tests/test_daterange.py
Original file line number Diff line number Diff line change
Expand Up @@ -1389,9 +1389,12 @@ def test_get_end(

def get_bounds(
ignore_breaks: bool,
) -> tuple[
tuple[list[pd.Timestamp], ...], bool, pd.Timestamp, pd.Timestamp, bool
] | None:
) -> (
tuple[
tuple[list[pd.Timestamp], ...], bool, pd.Timestamp, pd.Timestamp, bool
]
| None
):
# get bounds of session, or bounds of subsessions if session has a break
am_open = ans.opens[session]
pm_close = ans.closes[session]
Expand Down
1 change: 0 additions & 1 deletion tests/test_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ def mock_now_open(*_, tz=pytz.UTC, **__) -> pd.Timestamp:
return now

for d in delays:

assert f(None, session, as_dates, d) == (None, None)
assert f(session, None, as_dates, d) == (session, None)
assert f(session, None, as_times, d) == (session_first_minute, None)
Expand Down
1 change: 0 additions & 1 deletion tests/test_tutorial_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ def get_prices(t1_limit: pd.Timestamp, t5_limit: pd.Timestamp) -> PricesBase:
get_prices(T("2021-12-15 08:00"), T("2021-11-17 14:30")),
get_prices(T("2021-12-15 07:59"), T("2021-11-17 14:29")),
):

bi = prices.bis.T1
expected = T("2021-12-15"), T("2021-12-30")
assert f(prices, bi, xlon) == expected
Expand Down

0 comments on commit 3aacd17

Please sign in to comment.