Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
192 lines (172 loc) · 6.21 KB
/
Copy pathpyproject.toml
File metadata and controls
192 lines (172 loc) · 6.21 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = 'pySDC'
version = '5.9'
description = 'A Python implementation of spectral deferred correction methods and the likes'
license = {text = "BSD-2-Clause"}
readme = 'README.md'
authors=[
{name='Robert Speck', email='r.speck@fz-juelich.de'},
{name='Thibaut Lunet', email='thibaut.lunet@tuhh.de'},
{name='Thomas Baumann', email='t.baumann@fz-juelich.de'},
{name='Lisa Wimmer', email='wimmer@uni-wuppertal.de'},
{name='Ikrom Akramov', email='ikrom.akramov@tuhh.de'},
{name='Giacomo Rosilho De Souza', email='giacomo.rosilhodesouza@usi.ch'},
{name='Jakob Fritz', email='j.fritz@fz-juelich.de'},
{name='Jemma Shipton', email='j.shipton@exeter.ac.uk'},
{name='Abdelouahed Ouardghi', email='a.ouardghi@fz-juelich.de'},
{name='Gayatri Čaklović', email='caklovicka@gmail.com'},
]
classifiers = [
"Topic :: Scientific/Engineering :: Mathematics",
]
dependencies = [
'numpy>=1.15.4',
'scipy>=0.17.1',
'matplotlib>=3.0',
'sympy>=1.0',
# Only PenningTrap_3D uses numba, and it falls back to plain Python without it. Pyodide has no numba,
# so this marker is what lets `pip install pySDC` work in the browser.
'numba>=0.35; sys_platform != "emscripten"',
'dill>=0.2.6',
'qmat>=0.1.19',
]
[project.urls]
Homepage = "http://www.parallel-in-time.org/pySDC/"
Repository = "https://github.com/Parallel-in-Time/pySDC/"
Documentation = "http://www.parallel-in-time.org/pySDC/"
Tracker = "https://github.com/Parallel-in-Time/pySDC/issues"
[project.optional-dependencies]
apps = [
'petsc4py>=3.10.0',
'mpi4py>=3.0.0',
'fenics>=2019.1.0',
'mpi4py-fft>=2.0.2'
]
dev = [
'ruff',
'pytest',
'pytest-cov',
'sphinx',
'mypy',
'pre-commit'
]
# Scratch code, tests, retired projects and research artifacts stay in the
# repository but are not shipped. playgrounds/, tests/ and projects/deprecated/
# are already excluded from ruff, black and coverage below; the data/ directories
# and figure files are precomputed results for reproducing paper plots, not
# runtime data (core/, implementations/ and helpers/ contain no non-Python files).
# CI runs pytest against the checkout (pySDC/tests), not the installed package.
[tool.hatch.build]
exclude = [
'pySDC/playgrounds/',
'pySDC/tests/',
'pySDC/projects/deprecated/',
'**/data/',
'*.png',
'*.pdf',
'*.ipynb',
'**/.DS_Store',
]
[tool.hatch.build.targets.wheel]
packages = ['pySDC']
[tool.pytest.ini_options]
markers = [
'base: all basic tests',
'fenics: tests relying on FEniCS',
'slow: tests taking much longer than bearable',
'mpi4py: tests using MPI parallelism (but no other external library such as petsc)',
'petsc: tests relying on PETSc/petsc4py',
'benchmark: tests for benchmarking',
'cupy: tests for cupy on GPUs',
'libpressio: tests using the libpressio library',
'monodomain: tests the monodomain project, which requires previous compilation of c++ code',
'pytorch: tests for PyTorch related things in pySDC',
'firedrake: tests for firedrake',
# Added at runtime by mpi-pytest, and listed here so this stays the one place that
# describes pySDC's markers. It takes the ranks a test needs: `@pytest.mark.parallel(3)`
# or `@pytest.mark.parallel([2, 4])`. See etc/run_mpi_tests.sh for how CI runs them.
'parallel: tests that need a given number of MPI ranks, run through mpi-pytest',
]
timeout = 300
[tool.ruff]
line-length = 120
extend-exclude = [
'playgrounds',
'*/data/*'
]
[tool.ruff.lint]
# PT011 and PT012 are for the tests: a `pytest.raises` around several statements only ever runs
# the first one that raises, and one around a broad exception passes on any unrelated error.
select = ["C", "E", "F", "W", "B", "PT011", "PT012"]
ignore = ["E203", # Whitespace before punctuation
"E741", # Ambiguous variable name
"E402", # Module level import not at top of cell
"W605", # Invalid escape sequence
"F401", # unused import
"B023", # function uses loop variable
"B028", # No excplicit stackvariable
"C408", # Unnecessary collection call
"C417", # Unnecessary map usage
# Newly added
"C901", # Complex name
"E501", # Line length, as enforced by black, but black ignores comments
"E721", # Type comparison
]
# W504 is not supported by ruff and does not need to be excluded
[tool.ruff.lint.per-file-ignores]
"pySDC/projects/Hamiltonian/solar_system.py" = ["F401"]
[tool.black]
line-length = 120
skip-string-normalization = true
# `exclude` is only consulted while black walks a directory, so `black pySDC` skips playgrounds but
# anything passing file paths explicitly -- pre-commit, editors -- does not. `force-exclude` applies
# either way, which is what keeps the two agreeing.
exclude = '''playgrounds/'''
force-exclude = '''playgrounds/'''
[tool.coverage.run]
omit = ['*/pySDC/tests/*', '*/data/*', '*/pySDC/playgrounds/*', '*/pySDC/projects/deprecated/*', '*/pySDC/projects/*/tests/*']
relative_files = true
concurrency = ['multiprocessing']
source = ['pySDC']
[tool.coverage.report]
skip_empty = true
# Regexes for lines to exclude from consideration
exclude_lines = [
# Have to re-enable the standard pragma
'pragma: no cover',
# Don't complain about missing debug-only code:
'def __repr__',
'if self\.debug',
# Don't complain if tests don't hit defensive assertion code:
'raise',
# Don't complain if non-runnable code isn't run:
'if 0:',
'if __name__ == .__main__.:',
'pass',
'@abc.abstractmethod',
'__author__*',
]
[tool.mypy]
python_version = "3.10"
warn_return_any = false
warn_unused_configs = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = true
disallow_untyped_calls = false
disallow_untyped_decorators = false
no_implicit_optional = false
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
strict_equality = false
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "pySDC.core.*"
disallow_untyped_defs = true
disallow_incomplete_defs = true
warn_return_any = false
no_implicit_optional = false