Skip to content

Commit

Permalink
DOC: Fix height of the comic strip + minor doc improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kernc committed Jan 21, 2025
1 parent 8dd1e36 commit 614d2e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backtesting/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
![xkcd.com/1570](https://imgs.xkcd.com/comics/engineer_syllogism.png)
![xkcd.com/1570](https://imgs.xkcd.com/comics/engineer_syllogism.png){: height=263}
## Manuals
Expand Down
2 changes: 1 addition & 1 deletion backtesting/backtesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def init():
try:
value = func(*args, **kwargs)
except Exception as e:
raise RuntimeError(f'Indicator "{name}" error') from e
raise RuntimeError(f'Indicator "{name}" error. See traceback above.') from e

if isinstance(value, pd.DataFrame):
value = value.values.T
Expand Down
3 changes: 2 additions & 1 deletion backtesting/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,11 @@ def SMA(series, n):
if func is None:
def func(x, *_, **__):
return x
assert callable(func), 'resample_apply(func=) must be callable'

if not isinstance(series, (pd.Series, pd.DataFrame)):
assert isinstance(series, _Array), \
'resample_apply() takes either a `pd.Series`, `pd.DataFrame`, ' \
'resample_apply(series=) must be `pd.Series`, `pd.DataFrame`, ' \
'or a `Strategy.data.*` array'
series = series.s

Expand Down

0 comments on commit 614d2e8

Please sign in to comment.