-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
339 lines (312 loc) · 10.1 KB
/
pyproject.toml
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
[build-system]
requires = ["setuptools>=68.2", "setuptools-rust", "setuptools_scm[toml]>=8.0", "wheel>=0.41"]
build-backend = "setuptools.build_meta"
[project]
name = "artistools"
authors = [
{name = "Luke J. Shingles", email = "[email protected]"},
{name = "Christine E. Collins", email = "[email protected]"},
{name = "Alexander Holas", email = "[email protected]"},
{name = "Fionntan Callan", email = "[email protected]"},
{name = "Stuart Sim", email = "[email protected]"},
]
description="Plotting and analysis tools for the ARTIS 3D radiative transfer code for supernovae and kilonovae."
classifiers = [
"License :: OSI Approved :: MIT License",
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Rust",
"Framework :: Matplotlib",
"Intended Audience :: Science/Research",
]
dynamic = ["version", "dependencies"]
requires-python = ">=3.10"
license = {text = "MIT"}
readme = {file = "README.md", content-type='text/markdown'}
[project.urls]
Repository ="https://www.github.com/artis-mcrt/artistools"
Source = "https://www.github.com/artis-mcrt/artistools"
[project.scripts]
at = 'artistools.__main__:main'
artistools = 'artistools.__main__:main'
makeartismodel1dslicefromcone = 'artistools.inputmodel.slice1dfromconein3dmodel:main'
makeartismodel = 'artistools.inputmodel.makeartismodel:main'
plotartisdensity = 'artistools.inputmodel.plotdensity:main'
plotartisdeposition = 'artistools.deposition:main'
plotartisestimators = 'artistools.estimators.plotestimators:main'
plotartislightcurve = 'artistools.lightcurve.plotlightcurve:main'
plotartislinefluxes = 'artistools.linefluxes:main'
plotartismacroatom = 'artistools.macroatom:main'
plotartisnltepops = 'artistools.nltepops.plotnltepops:main'
plotartisnonthermal = 'artistools.nonthermal:main'
plotartisradfield = 'artistools.radfield:main'
plotartisspectrum = 'artistools.spectra.plotspectra:main'
plotartistransitions = 'artistools.transitions:main'
plotartisinitialcomposition = 'artistools.inputmodel.plotinitialcomposition:main'
plotartisviewingangles = 'artistools.viewing_angles_visualization:main'
[tool.black]
line-length = 120
target-version = ["py310", "py311", "py312", "py313"]
[tool.cibuildwheel]
build-frontend = "build[uv]"
archs = ["auto64"]
[tool.cibuildwheel.linux]
before-all = [
"mkdir -p /host/home/runner/work/artistools/artistools/rust/target",
"mkdir -p /project/rust/target",
"rm -rf /project/rust/target",
"ln -s -f /host/home/runner/work/artistools/artistools/rust/target /project/rust/",
"curl -sSf https://sh.rustup.rs | sh -s -- -y",
]
environment = { PATH="$HOME/.cargo/bin:$PATH"}
repair-wheel-command = [
"auditwheel repair -w {dest_dir} {wheel}",
"pipx run abi3audit --strict --report {wheel}",
]
[tool.cibuildwheel.macos]
repair-wheel-command = [
"delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}",
"uv pip install abi3audit",
"python3 -m abi3audit --strict --report {wheel}",
]
[tool.mypy]
check_untyped_defs = true
disallow_any_explicit = false
disallow_any_generics = false
disallow_any_unimported = false
disallow_incomplete_defs = false
disallow_subclassing_any = true
disallow_untyped_calls = false
disallow_untyped_decorators = true
disallow_untyped_defs = false
error_summary = true
enable_error_code = [
"comparison-overlap",
"ignore-without-code",
"no-any-return",
"no-any-unimported",
"no-untyped-call",
#"possibly-undefined",
"redundant-expr",
"redundant-self",
"truthy-bool",
"unused-awaitable",
]
exclude = "(build)|(dist)|(tests)|(data)|(test_*)"
extra_checks = true
ignore_missing_imports = true
implicit_optional = false
implicit_reexport = false
local_partial_types = true
packages = "artistools"
plugins = 'numpy.typing.mypy_plugin'
pretty = true
python_version = '3.13'
scripts_are_modules = true
strict_equality = true
warn_redundant_casts = true
warn_unreachable = false
warn_unused_configs = true
warn_unused_ignores = true
warn_return_any = true
# strict mode
[[tool.mypy.overrides]]
module = [
"artistools",
"artistools.estimators",
"artistools.commands",
"artistools.inputmodel",
"artistools.lightcurve",
"artistools.misc",
"artistools.packets",
"artistools.plotspherical",
"artistools.spectra",
"*.__init__",
"*.__main__",
]
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_defs = true
enable_error_code = [
"possibly-undefined",
]
[tool.pylint.'MESSAGES CONTROL']
max-line-length = 120
disable = """
broad-exception-caught,
fixme,
missing-function-docstring,
missing-module-docstring,
import-outside-toplevel,
invalid-name,
line-too-long,
no-member,
not-an-iterable,
not-context-manager,
possibly-used-before-assignment,
protected-access,
redefined-outer-name,
too-many-arguments,
too-many-branches,
too-many-function-args,
too-many-lines,
too-many-locals,
too-many-nested-blocks,
too-many-statements,
unbalanced-tuple-unpacking,
unused-argument,
unused-import,
unused-variable,
unspecified-encoding,
unsupported-assignment-operation,
C,
R,
"""
[tool.pylint.typecheck]
ignored-modules = ["astropy", "extinction", "pyvista"]
unsafe-load-any-extension = true
[tool.pyright]
deprecateTypingAliases = true
enableTypeIgnoreComments = false # leave these for mypy to interpret
exclude=['**/node_modules','**/__pycache__','**/.*', 'build', 'dist', 'target']
reportAttributeAccessIssue = false
reportCallIssue = true
reportMissingImports = false
reportPossiblyUnboundVariable = false
reportUnnecessaryTypeIgnoreComment = true
reportUnknownVariableType = false
typeCheckingMode = "standard"
useLibraryCodeForTypes = false
targetVersion = "3.10"
extraPaths=["../pynonthermal/"]
[tool.pytest.ini_options]
addopts = " --durations=0 --durations-min=1.0 --typeguard-packages=artistools -n auto"
[tool.refurb]
ignore = ["FURB120"]
quiet = false
enable_all = true
python_version = "3.10"
sort_by = "error"
[[tool.refurb.amend]]
path = "./artistools/inputmodel/fromcmfgen/rd_cmfgen.py"
ignore = ["FURB108"]
[tool.ruff]
line-length = 120
target-version = "py310"
fix = true
show-fixes = true
extend-exclude = ["_version.py"]
preview = true
[tool.ruff.format]
skip-magic-trailing-comma = true
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ARG001", # ignored because variables in df.eval() are not detected
"ANN001", # missing-type-function-argument
"ANN201", # missing-return-type-undocumented-public-function
"ANN003", # missing-type-kwargs
"ANN202", # missing-return-type-private-function
"ANN401", # any-type
"B005", # strip-with-multi-characters
"C901", # complex-structure
"COM812", # missing-trailing-comma
"CPY001", # missing-copyright-notice
"D100", # undocumented-public-module
"D101", # undocumented-public-class
"D102", # undocumented-public-method
"D103", # undocumented-public-function
"D104", # undocumented-public-package
"D107", # undocumented-public-init
"D203", # one-blank-line-before-class
"D213", # multi-line-summary-second-line
"D417", # undocumented-param
"DOC201", # docstring-missing-returns
"DOC402", # docstring-missing-yields
"DOC501", # docstring-missing-exception
"E501", # Line too long
"ERA001", # commented-out-code
"FBT",
"FIX002", # line contains TODO
"ISC001", # single-line-implicit-string-concatenation
"N802", # Function name should be lowercase
"N803", # Argument name should be lowercase
"N806", # non-lowercase-variable-in-function
"N815", # mixed-case-variable-in-class-scope
"PERF203", # try-except-in-loop
"PGH004", # blanket-noqa
"PLC0414", # useless-import-alias
"PLC0415", # import-outside-toplevel
"PLR0914", # too-many-locals
"PLR0917", # too-many-positional
"PLR1702", # too-many-nested-blocks
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0915", # too-many-statements
"PLR2004", # magic-value-comparison
"PLW2901", # redefined-loop-name
"PYI024", # Use `typing.NamedTuple` instead of `collections.namedtuple`
"S101", # Use of assert detected
"S311", # suspicious-non-cryptographic-random-usage
"S404", # suspicious-subprocess-import
"S603", # subprocess-without-shell-equals-true
"S607", # start-process-with-partial-path
"T201", # print found
"TD002", # missing-todo-author
"TD003", # missing-todo-link
]
fixable = ["ALL"]
unfixable = [
"ERA001", # commented-out-code (will just delete it!)
"F401", # unused-import (can be annoying to have import disappear while editing)
"F841", # unused-variable
"SIM222", # expr-or-true
"SIM223", # expr-and-false
]
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
"artistools" = "at"
"matplotlib" = "mpl"
#"matplotlib.axes" = "mplax"
"matplotlib.figure" = "mplfig"
"matplotlib.pyplot" = "plt"
"matplotlib.typing" = "mplt"
"numpy.typing" = "npt"
"typing" = "t"
"polars" = "pl"
"polars.selectors" = "cs"
"polars.testing" = "pltest"
"pynonthermal" = "pynt"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.isort]
force-single-line = true
order-by-type = false
[tool.setuptools]
include-package-data = true
license-files = ["LICENSE.txt"]
[[tool.setuptools-rust.ext-modules]]
target = "artistools.rustext" # The last part of the name has to match lib.name in Cargo.toml,
path = "rust/Cargo.toml"
binding = "PyO3"
debug = false
optional = false
[tool.setuptools.packages.find]
namespaces = true
where = ["."]
include = ["*", "**/matplotlibrc", "**/data"]
exclude = ["tests", "**/dist", "**/lib", "**/build", "*.egg-info", "**/.*", "**/target"]
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
[tool.setuptools_scm]
version_file = "_version.py"
local_scheme = "no-local-version"
[tool.vulture]
exclude = [".*", "build/", ".eggs/"]
#ignore_names = ["visit_*", "do_*"]
paths = ["artistools"]
sort_by_size = true