-
Notifications
You must be signed in to change notification settings - Fork 6
/
pyproject.toml
309 lines (280 loc) · 9.11 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
[project]
name = "galax"
description = "Galactic Dynamics in Jax."
dynamic = ["version"]
license = { text = "MIT License" }
readme = "README.md"
requires-python = ">=3.11"
authors = [
{ name = "galax maintainers", email = "[email protected]" },
{ name = "Adrian Price-Whelan", email = "[email protected]" },
{ name = "Jake Nibauer", email = "[email protected]" },
{ name = "Nathaniel Starkman", email = "[email protected]" },
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
dependencies = [
"astropy>=6.1.4",
"beartype>=0.19",
"coordinax>=0.13.4",
"dataclassish >= 0.3",
"diffrax>=0.6",
"equinox>=0.11.8",
"is-annotated>=1.0",
"jax>=0.4.33,!=0.4.34",
"jaxlib>=0.4.33,!=0.4.34",
"jaxtyping>=0.2.34",
"optional-dependencies>=0.3",
"packaging>=24.1",
"plotting_backends >= 0.1",
"quax>=0.0.4",
"quaxed>=0.6.4",
"typing-extensions>=4.11",
"unxt>=0.22.0",
"xmmutablemap>=0.1",
"zeroth>=0.1",
]
[project.optional-dependencies]
# All runtime dependencies
all = ["galax[interop-all,plot-all]"]
# Interoperability dependencies
interop-all = [
"galax[interop-astropy]",
"galax[interop-gala]",
"galax[interop-galpy]",
]
interop-astropy = ["astropy>=6.1"]
interop-gala = ["gala>=1.9", "galax[interop-astropy]"]
interop-galpy = ["galax[interop-astropy]", "galpy >= 1.8"]
# TODO: agama
plot-all = ["galax[plot-matplotlib]"]
plot-matplotlib = ["matplotlib>=3.8"]
[project.urls]
"Bug Tracker" = "https://github.com/GalacticDynamics/galax/issues"
Changelog = "https://github.com/GalacticDynamics/galax/releases"
Discussions = "https://github.com/GalacticDynamics/galax/discussions"
Homepage = "https://github.com/GalacticDynamics/galax"
[build-system]
build-backend = "hatchling.build"
requires = ["hatch-vcs", "hatchling"]
[dependency-groups]
# Development dependencies
dev = [
"ipykernel>=6.29.5",
{ include-group = "docs" },
{ include-group = "test-all" },
]
# Documentation dependencies
docs = [
"furo>=2024.8.6",
"myst_parser>=4.0",
"sphinx>=8.1",
"sphinx_autodoc_typehints>=2.5",
"sphinx_copybutton>=0.5.2",
]
# Test dependencies
test-all = [
{ include-group = "test" },
{ include-group = "test-mpl" },
]
test = [
"nox>=2024.10.9",
"pre-commit>=4.0.1",
"pytest-arraydiff>=0.6.1",
"pytest-cov>=5",
"pytest>=8.3",
"sybil>=8.0.0",
]
test-mpl = ["pytest-mpl>=0.17.0"]
[tool.hatch]
build.hooks.vcs.version-file = "src/galax/_version.py"
metadata.allow-direct-references = true
version.source = "vcs"
[tool.coverage]
report.exclude_also = [
# Have to re-enable the standard pragma
'pragma: no cover',
# Ignore type-checking stuff
'\.\.\.',
'if TYPE_CHECKING:',
'if typing.TYPE_CHECKING:',
# Ignore contents of abstract methods
'@abc.abstractmethod',
'@abstractmethod',
]
run.omit = ["*/utils/_boundinstance.py"]
run.source = ["galax"]
[tool.mypy]
python_version = "3.11"
disallow_incomplete_defs = true
disallow_untyped_defs = true
exclude = [
'(^/)docs/', # docs
'(^|/)tests/', # tests
'^conftest\.py$', # nox test configuration
]
strict = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
disable_error_code = ["no-redef"] # <- plum multiple dispatch
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
[[tool.mypy.overrides]]
disable_error_code = ["name-defined"] # <- jaxtyping
module = "galax.*"
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
"astropy.*",
"beartype.*",
"diffrax.*",
"equinox.*",
"hypothesis.*",
"jax.*",
"jax_cosmo.*",
"jaxtyping.*",
"numpy.*",
"scipy.*",
"sympy.*",
"sympy2jax.*",
]
[tool.pylint]
ignore-paths = [".*/_version.py"]
messages_control.disable = [
"design",
"fixme",
"function-redefined",
"import-outside-toplevel",
"invalid-name", # ruff N80*
"line-too-long",
"missing-module-docstring",
"protected-access", # ruff SLF001
"unnecessary-ellipsis",
"unnecessary-lambda-assignment", # ruff E731
"unnecessary-pass", # handled by ruff
"unused-argument", # handled by ruff
"useless-import-alias",
"wrong-import-order", # handled by ruff
"wrong-import-position",
]
py-version = "3.11"
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
[tool.pytest.ini_options]
addopts = [
"--arraydiff",
"--showlocals",
"--strict-config",
"--strict-markers",
"-ra",
]
filterwarnings = [
"error",
"ignore:Attribute s is deprecated:DeprecationWarning", # from Sybil
"ignore:Passing arguments 'a':DeprecationWarning", # TODO: from diffrax
"ignore:ast\\.Str is deprecated:DeprecationWarning", # from Sybil
"ignore:auto\\-close\\(\\)ing of figures upon backend switching is deprecated:DeprecationWarning",
"ignore:jax\\.core\\.pp_eqn_rules is deprecated:DeprecationWarning",
"ignore:numpy\\.ndarray size changed:RuntimeWarning",
"ignore:unhashable type:FutureWarning", # TODO: from diffrax
]
log_cli_level = "INFO"
markers = [
"serial",
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
minversion = "6.0"
testpaths = ["docs", "src/galax", "tests/"]
xfail_strict = true
[tool.ruff]
[tool.ruff.lint]
extend-select = ["ALL"]
ignore = [
"ANN101", # Missing type annotation for self in method
"ANN102", # Missing type annotation for cls in classmethod
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in `*args`
"COM812", # Missing trailing comma in Python 3.6+
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"E741", # Ambiguous variable name
"F722", # Syntax error in forward annotation <- jaxtyping
"F811", # Redefinition <- plum multiple dispatch
"F821", # undefined name <- jaxtyping
"FIX002", # Line contains TODO, consider resolving the issue
"ISC001", # Implicit string concatenation <- ruff-format
"N80", # Naming conventions.
"PD", # pandas-vet
"PLC0414", # Import alias does not rename original package
"PLR", # Design related pylint codes
"PYI041", # Use `float` instead of `int | float` <- beartype is more strict
"TCH00", # Move into a type-checking block
"TD002", # Missing author in TODO
"TD003", # Missing issue link on the line following this TODO
"UP037", # Remove quote from type annotation <- jaxtyping
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F403"]
"__init__.pyi" = ["F401", "F403"]
"docs/conf.py" = [
"A001", # Variable `copyright` is shadowing a Python builtin
"INP001", # implicit namespace package
]
"notebooks/**" = ["ANN", "D103", "FBT", "T201"]
"noxfile.py" = ["ERA001", "T20"]
"tests/**" = [
"ANN",
"ARG001",
"ARG002",
"D10",
"E731",
"ERA001", # Found commented-out code # TODO: remove this
"FBT001", # Boolean-typed positional argument in a function definition
"INP001",
"RET504",
"S101",
"S301",
"SLF001",
"T20",
"TID252", # Relative imports from parent modules are banned
]
[tool.ruff.lint.flake8-type-checking]
exempt-modules = []
[tool.ruff.lint.isort]
combine-as-imports = true
extra-standard-library = ["typing_extensions"]
known-first-party = [
"coordinax",
"dataclassish",
"galactic_dynamics_interoperability",
"is_annotated",
"optional_dependencies",
"plotting_backends",
"quaxed",
"unxt",
"xmmutablemap",
"zeroth",
]
known-local-folder = ["galax"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.uv]
dev-dependencies = [
"ipykernel>=6.29.5",
"pytest-arraydiff>=0.6.1",
"pytest>=8.3.3",
"sybil>=8.0.0",
]