-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
222 lines (201 loc) · 6.73 KB
/
pyproject.toml
File metadata and controls
222 lines (201 loc) · 6.73 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/seu_injection"]
[project]
name = "seu-injection-framework"
version = "1.1.12"
description = "Framework for Single Event Upset (SEU) injection in neural networks for harsh environment applications"
authors = [
{name = "William Dennis", email = "wwdennis.home@gmail.com"}
]
readme = "README.md"
license = {text = "MIT"}
homepage = "https://github.com/wd7512/seu-injection-framework"
repository = "https://github.com/wd7512/seu-injection-framework"
keywords = ["machine-learning", "robustness", "fault-tolerance", "seu", "radiation", "neural-networks"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Testing",
"Environment :: GPU :: NVIDIA CUDA",
"Natural Language :: English",
"Typing :: Typed",
]
requires-python = ">=3.9"
# Core dependencies (intentionally slimmed; heavier analysis libs moved to extras)
dependencies = [
"torch>=2.0.0",
"numpy>=1.21.0,<2.0.0",
"tqdm>=4.60.0",
]
[project.optional-dependencies]
# Development & testing (includes analysis libs to keep tests stable)
dev = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"ruff>=0.1.0",
"bandit>=1.7.0",
"psutil>=7.1.3",
"scikit-learn>=1.1.0",
"pandas>=1.4.0",
"matplotlib>=3.5.0",
"seaborn>=0.11.0",
"scikit-image>=0.19.0",
"statsmodels>=0.13.0",
"joblib>=1.1.0",
"torchvision>=0.15.0",
"mdformat>=0.7.22",
"mdformat-gfm>=0.4.1",
"mdformat-toc>=0.5.0",
"scipy>=1.8.0",
"ty>=0.0.1a28",
]
# Analysis & extended research stack
analysis = [
"scikit-learn>=1.1.0",
"pandas>=1.4.0",
"matplotlib>=3.5.0",
"seaborn>=0.11.0",
"scikit-image>=0.19.0",
"statsmodels>=0.13.0",
"joblib>=1.1.0",
]
# Vision / model zoo extras
vision = [
"torchvision>=0.15.0",
]
# Notebook / interactive usage
notebooks = [
"jupyter>=1.0.0",
"jupyterlab>=3.0.0",
"ipywidgets>=7.0.0",
]
# Documentation toolchain (optional)
docs = [
"sphinx>=7.0.0",
"sphinx-rtd-theme>=2.0.0",
"sphinx-autodoc-typehints>=1.25.0",
"myst-parser>=2.0.0",
]
# Examples
examples = [
"kagglehub>=0.1.0"
]
# Aggregate convenience extra
all = [
"seu-injection-framework[dev,analysis,vision,notebooks,docs,examples]"
]
[project.urls]
"Homepage" = "https://github.com/wd7512/seu-injection-framework"
"Documentation" = "https://wd7512.github.io/seu-injection-framework/"
"Repository" = "https://github.com/wd7512/seu-injection-framework"
"Bug Tracker" = "https://github.com/wd7512/seu-injection-framework/issues"
"Changelog" = "https://github.com/wd7512/seu-injection-framework/blob/main/CHANGELOG.md"
"Research Paper" = "https://research-information.bris.ac.uk/en/publications/a-framework-for-developing-robust-machine-learning-models-in-hars"
"Download" = "https://pypi.org/project/seu-injection-framework/"
# Tool configurations for code quality
# TODO PIPELINE FIX: Coverage configuration addressed per PIPELINE_FIX_URGENT.md
# ISSUE: Global --cov-fail-under=50 in pytest addopts breaks isolated test runs (benchmarks get 23% coverage)
# SOLUTION IMPLEMENTED: Removed global threshold, now enforced only in CI/CD for full test suite
# CURRENT STATUS: Full test suite achieves 94% coverage (well above 50% minimum requirement)
# ENFORCEMENT: CI/CD pipeline enforces --cov-fail-under=50 on complete test runs only
# BENEFIT: Allows individual test files and benchmark tests to run without coverage failures
# REFERENCE: See .github/workflows/python-tests.yml for CI/CD enforcement implementation
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--cov=src/seu_injection",
"--cov-report=term-missing",
"--cov-report=html:htmlcov",
# TODO: --cov-fail-under=50 REMOVED from global config per pipeline fix
# REASON: Benchmark tests achieve 23% coverage when run isolated, failing 50% threshold
# CURRENT: Coverage threshold enforced in CI/CD for full suite only (94% > 50%)
# Note: Coverage threshold removed from default addopts to allow individual test file runs
# Use --cov-fail-under=50 when running full test suite if desired
"-v",
"--tb=short",
"--strict-markers"
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"smoke: marks tests as smoke tests for quick validation",
"gpu: marks tests that require GPU/CUDA",
]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
]
[tool.coverage.run]
source = ["src/seu_injection"]
omit = [
"*/tests/*",
"*/test_*.py",
"*/__pycache__/*",
"*/conftest.py",
"*/utils/device.py",
"*/utils/__init__.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
# Ruff configuration for linting and formatting
[tool.ruff]
line-length = 88
target-version = "py39"
src = ["src", "tests"]
extend-exclude = ["*.ipynb"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"A", # flake8-builtins
"C4", # flake8-comprehensions
"T20", # flake8-print
]
ignore = [
"E501", # Line too long (handled by formatter)
"B008", # Do not perform function calls in argument defaults
"B905", # zip strict argument
"N806", # Variable name in function should be lowercase (allow ML conventions like X, y)
"T201", # Print found (allow for debugging/standalone scripts)
"B011", # Do not use assert False (pytest uses this pattern)
"F401", # Imported but unused (some imports are for testing availability)
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.ty.src]
exclude = ["**/*_legacy*.py"]