-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
138 lines (122 loc) · 3.58 KB
/
pyproject.toml
File metadata and controls
138 lines (122 loc) · 3.58 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
[project]
name = "self-interferometry"
version = "0.1.0"
description = "Self-Mixing Interferometry for Rapid Vibration/Acoustic Spectrograms"
authors = [
{name = "Nolan Peard", email = "nolan.peard@gmail.com"},
]
readme = "README.md"
requires-python = ">=3.12"
license = {text = "MIT"}
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = [
"numpy==1.26.4",
"matplotlib",
"numba",
"torch>=2.9.0",
"lightning",
"h5py",
"tqdm",
"pyyaml",
"scipy",
]
[project.urls]
"Homepage" = "https://github.com/npeard/self-interferometry"
"Bug Tracker" = "https://github.com/npeard/self-interferometry/issues"
[build-system]
requires = ["flit_core>=3.9.0,<4"]
build-backend = "flit_core.buildapi"
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = "test_*.py"
addopts = "--verbose"
[project.optional-dependencies]
test = [
"pytest>=8.0",
"pytest-cov>=3.0",
"pytest-xdist>=2.5",
"pytest-benchmark",
]
dev = [
"pytest>=8.0.0",
"black",
"ruff",
"codespell",
"taskipy",
"pre-commit",
"nbstripout",
"marimo",
"lmfit",
"uncertainties",
"schemdraw",
]
[tool.flit.module]
name = "self_interferometry"
[tool.black]
line-length = 88
target-version = ["py312"]
include = '\.pyi?$'
[tool.ruff.format]
quote-style = "single"
docstring-code-format = true
skip-magic-trailing-comma = true
[tool.ruff.lint]
select = [
"F", "E", "W", "C90", "I", "D", "UP", "YTT", "ANN", "BLE", "B", "A", "C4", "FA",
"INP", "NPY201", "PIE", "T20", "PYI", "PT", "RSE", "RET", "SLF", "SIM", "INT",
"ARG", "PTH", "PL", "TRY", "FLY", "NPY", "RUF", "S", "N", "PERF", "FURB",
]
extend-select = ["D204", "D400", "D404", "D406", "D410"]
ignore = [
# Import-related (keep for __init__.py files)
"F403", "F405",
# Style preferences
"E741", # Ambiguous variable names (sometimes necessary in scientific code)
# Documentation (reasonable for scientific/research code)
"D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107", "D205", "D405", "D417",
# Type annotations (reasonable choices)
"ANN002", "ANN003", "ANN401",
# Argument usage (common in scientific APIs)
"ARG001",
# Return style preference
"RET505",
# Exception handling (reasonable for research code)
"TRY003",
# Complexity (reasonable limits for scientific code)
"PLR0913", "PLR2004",
# Private access (sometimes needed for scientific libraries)
"SLF001",
# Security (may need adjustment based on your needs)
"S101", # Use of assert (common in scientific code)
"S311", # Random generators (often fine for scientific use)
# Naming (scientific computing often uses uppercase for matrices/operators)
"N806", "N802", # Variable names should be lowercase (conflicts with math notation)
]
[tool.ruff.lint.isort]
split-on-trailing-comma = false
[tool.ruff.lint.flake8-annotations]
suppress-none-returning = true
[tool.ruff.lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"docs/**.py" = ["INP001", "ARG001", "ANN"]
"conftest.py" = ["ANN"]
"tests/**.py" = ["ANN"]
"*.ipynb" = ["ALL"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.codespell]
skip = ".git,*.ipynb"
[tool.taskipy.tasks]
test = "pytest"
lint = "ruff check ."
format = "ruff format . && ruff check --fix ."
spell = "codespell ."
precommit = "pre-commit run --all-files"
all = "task format && task lint && task test"