Skip to content

Commit 6d5e82e

Browse files
committed
Fix linting configuration for TA-Lib style function names and format code
1 parent c424138 commit 6d5e82e

File tree

7 files changed

+278
-281
lines changed

7 files changed

+278
-281
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ unfixable = []
162162
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
163163

164164
[tool.ruff.per-file-ignores]
165+
"src/project_x_py/indicators/__init__.py" = ["N802"] # Allow uppercase function names for TA-Lib style compatibility
165166
"tests/**/*" = ["S101", "PLR2004", "PLR0913", "PLR0915"]
166167
"__init__.py" = ["F401"]
167168

@@ -266,9 +267,9 @@ dev = [
266267
"mypy>=1.0.0",
267268
"black>=23.0.0",
268269
"isort>=5.12.0",
269-
"pre-commit>=4.2.0",
270270
"pytest-asyncio>=1.1.0",
271271
"pytest-mock>=3.14.1",
272+
"pre-commit>=4.2.0",
272273
]
273274
test = [
274275
"pytest>=8.4.1",

src/project_x_py/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@
173173
"detect_candlestick_patterns",
174174
"detect_chart_patterns",
175175
"extract_symbol_from_contract_id",
176-
"find_support_resistance_levels",
177176
"format_price",
178177
"format_volume",
179178
"get_env_var",

src/project_x_py/indicators/base.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@
88
"""
99

1010
from abc import ABC, abstractmethod
11-
from typing import Any
1211

1312
import polars as pl
1413

1514

1615
class IndicatorError(Exception):
1716
"""Custom exception for indicator calculation errors."""
1817

19-
pass
20-
2118

2219
class BaseIndicator(ABC):
2320
"""
@@ -101,7 +98,6 @@ def calculate(self, data: pl.DataFrame, **kwargs) -> pl.DataFrame:
10198
Returns:
10299
DataFrame with indicator columns added
103100
"""
104-
pass
105101

106102
def __call__(self, data: pl.DataFrame, **kwargs) -> pl.DataFrame:
107103
"""

src/project_x_py/indicators/momentum.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
from .base import (
1414
MomentumIndicator,
1515
ema_alpha,
16-
rolling_sum_negative,
17-
rolling_sum_positive,
1816
safe_division,
1917
)
2018

src/project_x_py/indicators/overlap.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,10 @@ def wma_func(values):
307307
return None
308308
recent_values = values[-period:]
309309
return (
310-
sum(val * weight for val, weight in zip(recent_values, weights))
310+
sum(
311+
val * weight
312+
for val, weight in zip(recent_values, weights, strict=False)
313+
)
311314
/ weight_sum
312315
)
313316

src/project_x_py/indicators/volatility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import polars as pl
1212

13-
from .base import VolatilityIndicator, ema_alpha, safe_division
13+
from .base import VolatilityIndicator, safe_division
1414

1515

1616
class ATR(VolatilityIndicator):

uv.lock

Lines changed: 271 additions & 271 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)