Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
295 lines (265 loc) · 6.51 KB
/
Copy pathpyproject.toml
File metadata and controls
295 lines (265 loc) · 6.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# ML4T Engineer - feature engineering for financial machine learning
# Independent package configuration for standalone distribution
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.targets.wheel]
packages = ["src/ml4t"]
namespaces = true
# Include AGENTS.md files for agent navigation
artifacts = ["src/ml4t/**/AGENTS.md"]
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/tests",
"/README.md",
"/LICENSE",
"/CHANGELOG.md",
]
[project]
name = "ml4t-engineer"
dynamic = ["version"]
description = "Feature engineering, labeling, alternative bars, and leakage-safe datasets for financial ML."
readme = "README.md"
license = { text = "MIT" }
authors = [
{ name = "Stefan Jansen", email = "stefan@applied-ai.com" },
]
maintainers = [
{ name = "Stefan Jansen", email = "pm@ml4trading.io" },
]
keywords = [
"finance",
"algorithmic-trading",
"features",
"feature-engineering",
"machine-learning",
"trading",
"backtesting",
"quantitative-finance",
"technical-analysis",
"microstructure",
"labeling",
"polars",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Financial and Insurance Industry",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Office/Business :: Financial :: Investment",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Typing :: Typed",
]
requires-python = ">=3.12,<3.15"
# Core dependencies
dependencies = [
"ml4t-specs>=0.1.0,<0.2.0",
# Data processing (Polars-first)
"polars>=0.20.0",
"pandas>=2.0.0",
"numpy>=1.24.0,<2.6",
# Performance optimization
"numba>=0.57.0",
# Configuration
"pydantic>=2.0.0,<3",
"pyyaml>=6.0.0",
# Utilities
"structlog>=23.0.0",
"python-dateutil>=2.8.0",
]
[project.optional-dependencies]
# Technical analysis libraries
ta = [
"ta-lib>=0.4.0,<0.8",
]
# Feature store with DuckDB
store = [
"duckdb>=0.9.0",
"pyarrow>=14.0.0",
]
# Trading calendar support
calendars = [
"pandas-market-calendars>=4.0.0",
]
# Statistical diagnostics
stats = [
"statsmodels>=0.14.0",
]
# Visualization and plotting
viz = [
"plotly>=5.15.0",
"matplotlib>=3.7.0",
"seaborn>=0.12.0",
"pyarrow>=14.0.0",
]
# ML diagnostics
ml = [
"lightgbm>=4.0.0",
"shap>=0.44.0",
]
# Development tools
dev = [
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"pytest-xdist>=3.3.0",
"pytest-timeout>=2.1.0",
"pytest-benchmark>=4.0.0",
"hypothesis>=6.80.0",
"ruff>=0.1.0",
"ipython>=8.14.0",
"ipdb>=0.13.0",
"pre-commit>=3.3.0",
"duckdb>=0.9.0",
"pandas-market-calendars>=4.0.0",
"ta-lib>=0.4.0,<0.8",
"yfinance>=0.2.0",
"lightgbm>=4.0.0",
"shap>=0.44.0",
"arch>=6.0.0",
"pyarrow>=14.0.0",
"statsmodels>=0.14.0",
]
# Documentation generation
docs = [
"mkdocs>=1.6,<2",
"mkdocs-material>=9.5.0",
"mkdocstrings[python]>=0.24.0",
]
# Complete installation
all = [
"ta-lib>=0.4.0,<0.8",
"duckdb>=0.9.0",
"pandas-market-calendars>=4.0.0",
"plotly>=5.15.0",
"matplotlib>=3.7.0",
"seaborn>=0.12.0",
"lightgbm>=4.0.0",
"shap>=0.44.0",
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"pytest-xdist>=3.3.0",
"pytest-timeout>=2.1.0",
"pytest-benchmark>=4.0.0",
"hypothesis>=6.80.0",
"ruff>=0.1.0",
"ipython>=8.14.0",
"ipdb>=0.13.0",
"pre-commit>=3.3.0",
"arch>=6.0.0",
"pyarrow>=14.0.0",
"statsmodels>=0.14.0",
"mkdocs>=1.6,<2",
"mkdocs-material>=9.5.0",
"mkdocstrings[python]>=0.24.0",
]
[project.urls]
Homepage = "https://www.ml4trading.io/"
Documentation = "https://www.ml4trading.io/docs/engineer/"
Repository = "https://github.com/ml4t/engineer"
Issues = "https://github.com/ml4t/engineer/issues"
Changelog = "https://github.com/ml4t/engineer/releases"
[dependency-groups]
test = [
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"pytest-xdist>=3.3.0",
"pytest-timeout>=2.1.0",
"pytest-benchmark>=4.0.0",
"hypothesis>=6.80.0",
]
dev = [
{ include-group = "test" },
"ruff>=0.8.0",
"ty",
"pre-commit>=3.3.0",
"twine>=6.0.0",
"pip-audit>=2.10.1",
"pandas-market-calendars>=4.0.0",
"duckdb>=0.9.0",
"matplotlib>=3.7.0",
"pyarrow>=14.0.0",
"statsmodels>=0.14.0",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-ra",
"--strict-markers",
"-m", "not perf",
"--capture=no", # Disable capture to avoid crash with numba/numpy on Python 3.13
"--cov=ml4t.engineer",
"--cov-report=term-missing",
"--cov-report=html",
]
markers = [
"slow: marks tests as slow",
"integration: marks tests as integration tests",
"benchmark: marks benchmark tests",
"perf: marks performance comparison tests (excluded from default runs, use pytest -m perf)",
"performance: marks performance tests",
"validation: marks tests that validate against TA-Lib",
"property: marks property-based tests using hypothesis",
]
[tool.ruff]
line-length = 100
target-version = "py312"
fix = true
[tool.ruff.lint]
select = [
"E",
"W",
"F",
"I",
"B",
"C4",
"UP",
"ARG",
"SIM",
]
ignore = [
"E501", # Line too long
"B008", # Function call in default argument
"B905", # zip without explicit strict
"SIM108", # Ternary operator (prefer readability of if/else blocks)
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["E402", "ARG002", "B017", "F841"]
[tool.ty.environment]
python-version = "3.12"
root = ["src"]
[tool.ty.src]
include = ["src"]
exclude = ["tests", "benchmarks", "examples", "docs"]
[tool.coverage.run]
branch = true
source = ["src/ml4t/engineer"]
omit = [
"*/tests/*",
"*/__init__.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if __name__ == .__main__.:",
"raise NotImplementedError",
"pass",
"except ImportError:",
]