Skip to content

Commit e52775b

Browse files
committed
style: format code with black 26.1.0 and pin version in CI
1 parent c7befeb commit e52775b

140 files changed

Lines changed: 153 additions & 40 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Install linting tools
3737
run: |
3838
python -m pip install --upgrade pip
39-
pip install ruff black isort
39+
pip install ruff 'black==26.1.0' isort
4040
4141
- name: Run ruff
4242
run: ruff check backtrader/

backtrader/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
- Documentation: https://www.backtrader.com/docu/
4646
- GitHub: https://github.com/mementum/backtrader
4747
"""
48+
4849
# Load contributed indicators and studies
4950
from .indicators import contrib as _indicators_contrib
5051

backtrader/analyzer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
... def get_analysis(self):
3030
... return {'trade_count': self.trades}
3131
"""
32+
3233
import calendar
3334
import datetime
3435
import pprint as pp

backtrader/analyzers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
>>> cerebro.addanalyzer(bt.analyzers.Sharpe, _name='sharpe')
2929
>>> cerebro.addanalyzer(bt.analyzers.DrawDown, _name='drawdown')
3030
"""
31+
3132
# The modules below should/must define __all__ with the objects wishes
3233
# or prepend an "_" (underscore) to private classes/variables
3334

backtrader/analyzers/annualreturn.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
>>> results = cerebro.run()
1414
>>> print(results[0].analyzers.annret.get_analysis())
1515
"""
16+
1617
from collections import OrderedDict
1718

1819
from ..analyzer import Analyzer

backtrader/analyzers/calmar.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
>>> results = cerebro.run()
1414
>>> print(results[0].analyzers.calmar.get_analysis())
1515
"""
16+
1617
import collections
1718
import math
1819

backtrader/analyzers/drawdown.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
>>> results = cerebro.run()
1515
>>> print(results[0].analyzers.dd.get_analysis())
1616
"""
17+
1718
from ..analyzer import Analyzer, TimeFrameAnalyzerBase
1819
from ..utils import AutoOrderedDict
1920

backtrader/analyzers/leverage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
>>> results = cerebro.run()
1414
>>> print(results[0].analyzers.lev.get_analysis())
1515
"""
16+
1617
from ..analyzer import Analyzer
1718

1819

backtrader/analyzers/logreturnsrolling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
>>> cerebro = bt.Cerebro()
1212
>>> cerebro.addanalyzer(bt.analyzers.LogReturnsRolling)
1313
"""
14+
1415
import collections
1516
import math
1617

backtrader/analyzers/periodstats.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
>>> results = cerebro.run()
1414
>>> print(results[0].analyzers.stats.get_analysis())
1515
"""
16+
1617
from ..analyzer import Analyzer
1718
from ..dataseries import TimeFrame
1819
from ..mathsupport import average, standarddev

0 commit comments

Comments
 (0)