Skip to content

Commit

Permalink
chore: fix laguerre - it should return a series like all others
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Aug 3, 2024
1 parent 4b17cb5 commit 7d4915c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions technical/indicators/indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def ichimoku(
#
# Laguerre RSI
#
def laguerre(dataframe, gamma=0.75, smooth=1, debug=bool):
def laguerre(dataframe, gamma=0.75, smooth=1, debug=bool) -> Series:
"""
laguerre RSI
Author Creslin
Expand Down Expand Up @@ -179,7 +179,7 @@ def laguerre(dataframe, gamma=0.75, smooth=1, debug=bool):
else:
lrsi_l.append(0)

return lrsi_l
return Series(lrsi_l)


########################################
Expand Down
7 changes: 1 addition & 6 deletions tests/test_indicators_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
(ti.fibonacci_retracements, [], "series", None),
(ti.hull_moving_average, [10], "series", None),
(ti.ichimoku, [], "dict", None),
(ti.laguerre, [], "list", None),
(ti.laguerre, [], "series", None),
(ti.madrid_sqz, [], "tuple", None),
(ti.mmar, [], "tuple", None),
(ti.osc, [], "series", None),
Expand Down Expand Up @@ -56,11 +56,6 @@ def test_indicators_generic_interface(
assert isinstance(res, tuple)
assert len(res[0]) == 1000
assert len(res[1]) == 1000
elif responsetype == "list":
# only laguerre is this
# TODO: This should be changed!
assert isinstance(res, list)
assert len(res) == 1000
elif responsetype == "dict":
assert isinstance(res, dict)
assert len(res["tenkan_sen"]) == 1000
Expand Down

0 comments on commit 7d4915c

Please sign in to comment.