Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
Linting for flake8 advices.
  • Loading branch information
maread99 committed Sep 10, 2023
1 parent 76960c7 commit 3184018
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/market_analy/movements_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class MovementProto(typing.Protocol):
duration: int

def __eq__(self, other):
if not type(self) == type(other):
if not isinstance(self, type(other)):
return False
for name in self.__dataclass_fields__.keys():
v, v_other = getattr(self, name), getattr(other, name)
Expand Down
2 changes: 1 addition & 1 deletion src/market_analy/trends_alt.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class Movement(MovementProto):
rvr_arr: np.ndarray

def __eq__(self, other):
if not type(self) == type(other):
if not isinstance(self, type(other)):
return False
for name in self.__dataclass_fields__.keys():
v, v_other = getattr(self, name), getattr(other, name)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,11 +1001,11 @@ def test_plot_ohlc(self, analy, intraday_pp):
assert ch_bot.vhair.x[0] == pd.Timestamp("2023-01-09 15:05")

# verify effect of `log_scale` and `max_ticks` kwargs
assert type(gui.chart.scales["y"]) == bq.scales.LogScale
assert isinstance(gui.chart.scales["y"], bq.scales.LogScale)
assert gui._icon_row_top.children[-1].tooltip == "Close" # close gui
gui._icon_row_top.children[-1].click()
gui = analy.plot(**intraday_pp, display=False, log_scale=False, max_ticks=50)
assert type(gui.chart.scales["y"]) == bq.scales.LinearScale
assert isinstance(gui.chart.scales["y"], bq.scales.LinearScale)
expected = pd.Interval(
pd.Timestamp("2023-01-10 12:05"), pd.Timestamp("2023-01-10 16:15"), "left"
)
Expand Down Expand Up @@ -2542,7 +2542,7 @@ def test_plot_mult(self, analy, intraday_pp, tz):
assert ch_bot.vhair.x[0] == pd.Timestamp("2023-01-09 15:55")

# verify effect of `log_scale`, `max_ticks` and 'rebase_on_zoom' kwargs
assert type(gui.chart.scales["y"]) == bq.scales.LogScale
assert isinstance(gui.chart.scales["y"], bq.scales.LogScale)
assert gui._icon_row_top.children[-1].tooltip == "Close"
gui._icon_row_top.children[-1].click() # close gui
gui = analy.plot(
Expand All @@ -2552,7 +2552,7 @@ def test_plot_mult(self, analy, intraday_pp, tz):
max_ticks=50,
rebase_on_zoom=False,
)
assert type(gui.chart.scales["y"]) == bq.scales.LinearScale
assert isinstance(gui.chart.scales["y"], bq.scales.LinearScale)
expected = pd.Interval(
pd.Timestamp("2023-01-10 07:05"), pd.Timestamp("2023-01-10 11:15"), "left"
)
Expand Down

0 comments on commit 3184018

Please sign in to comment.