-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpyproject.toml
More file actions
478 lines (433 loc) · 14.5 KB
/
pyproject.toml
File metadata and controls
478 lines (433 loc) · 14.5 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
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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
[project]
authors = [
{ name = "Coordinax Devs", email = "nstarman@users.noreply.github.com" },
{ name = "Nathaniel Starkman", email = "nstarman@users.noreply.github.com" },
{ name = "Adrian Price-Whelan", email = "adrn@users.noreply.github.com" },
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
dependencies = [
"astropy>=7.0.0",
"beartype>=0.21.0",
"coordinax.api",
"dataclassish>=0.8.0",
"equinox>=0.13.2",
"jax>=0.6.0",
"jaxlib>=0.6.0",
"jaxtyping>=0.3.3",
"optional-dependencies>=0.3.2",
"plum>=2.8.0",
"quax>=0.2.1",
"quax-blocks>=0.4.0",
"quaxed>=0.10.4",
"typing-extensions>=4.13.2",
"unxt>=1.11.1",
"wadler-lindig>=0.1.6",
"xmmutablemap>=0.1",
]
description = "Coordinates in JAX"
dynamic = ["version"]
license = "MIT"
license-files = ["LICENSE"]
name = "coordinax"
readme = "README.md"
requires-python = ">=3.11"
[project.optional-dependencies]
astro = ["coordinax.astro"]
benchmark = ["pytest-benchmark>=5.2.3"]
curveframes = ["coordinax.curveframes"]
interop-astropy = ["coordinax.interop.astropy"]
workspace = [
"coordinax.api",
"coordinax.astro",
"coordinax.curveframes",
"coordinax.hypothesis",
"coordinax.interop.astropy",
]
[project.urls]
"Bug Tracker" = "https://github.com/GalacticDynamics/coordinax/issues"
Changelog = "https://github.com/GalacticDynamics/coordinax/releases"
Discussions = "https://github.com/GalacticDynamics/coordinax/discussions"
Homepage = "https://github.com/GalacticDynamics/coordinax"
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling", "hatch-vcs"]
[dependency-groups]
build = ["build>=1.3.0"]
dev = [
"cz-conventional-gitmoji>=0.6.1",
{ include-group = "build" },
{ include-group = "docs" },
{ include-group = "ide" },
{ include-group = "lint" },
{ include-group = "nox" },
{ include-group = "test-all" },
]
docs = [
"jaxmore>=0.3.0",
"jupyter-cache>=1.0.0",
"jupytext>=1.16.4",
"myst-nb>=1.1.2",
"myst_parser>=0.13",
"pytz>=2024.2", # for copyright date
"sphinx-autobuild>=2024.9.3",
"sphinx-book-theme==1.1.3",
"sphinx-prompt>=1.8.0",
"sphinx-tippy>=0.4.3",
"sphinx>=7.0",
"sphinx_autodoc_typehints>=3.0.0",
"sphinx_copybutton>=0.5.2",
"sphinx_design>=0.6.1",
"sphinx_togglebutton>=0.3.2",
"sphinxext-opengraph>=0.9.1",
"sphinxext-rediraffe>=0.2.7",
]
ide = ["ipykernel>=7.1.0", "jaxmore>=0.2.0"]
lint = ["pre-commit>=4.5.0", "pylint>=3.3.2", "ty>=0.0.19"]
nox = ["nox>=2024.10.9", "nox-uv>=0.6.3"]
test = [
"coordinax.curveframes",
"coordinax.hypothesis",
"hypothesis[numpy]>=6.151.6",
"jaxmore>=0.2.0",
"pytest>=8.3.3",
"pytest-arraydiff>=0.6.1",
"pytest-cov>=6.2.1",
"pytest-env>=1.1.5",
"pytest-github-actions-annotate-failures>=0.3.0",
"sybil[pytest]>=8.0.0",
]
test-all = [{ include-group = "test" }]
[tool.jupytext]
cell_metadata_filter = "tags,-all"
formats = "ipynb,md:myst"
notebook_metadata_filter = "kernelspec,language_info,jupytext"
[tool.hatch]
build.hooks.vcs.version-file = "src/coordinax/_version.py"
build.hooks.vcs.version-file-template = """\
version: str = {version!r}
version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str]
version_tuple = {version_tuple!r}
"""
build.targets.wheel.packages = ["src/coordinax"]
version.source = "vcs"
[tool.hatch.version.raw-options]
local_scheme = "no-local-version"
[tool.hatch.version.raw-options.scm.git]
describe_command = [
"git",
"describe",
"--dirty",
"--tags",
"--long",
"--match",
"coordinax-v*",
]
[tool.codespell]
skip = ["uv.lock"]
[tool.repo-review]
ignore = ["PC140"] # ty is run via nox, not pre-commit
[tool.commitizen]
name = "cz_gitmoji"
[tool.coverage]
run.source = ["coordinax"]
[tool.coverage.report]
exclude_also = [
# Have to re-enable the standard pragma
'pragma: no cover',
# Ignore type-checking stuff
'if typing.TYPE_CHECKING:',
'if TYPE_CHECKING:',
'\.\.\.',
# Ignore contents of abstract methods
'@abc.abstractmethod',
'@abstractmethod',
]
[tool.mypy]
disable_error_code = [
"no-redef", # for plum-dispatch
"name-defined", # for jaxtyping
]
disallow_incomplete_defs = false
disallow_untyped_defs = false
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
explicit_package_bases = true
files = [
"src/coordinax",
"packages/coordinax.api/src/coordinax/api",
"packages/coordinax.astro/src/coordinax/astro",
"packages/coordinax.curveframes/src/coordinax/curveframes",
"packages/coordinax.hypothesis/src/coordinax/hypothesis",
"packages/coordinax.interop.astropy/src/coordinax/interop/astropy",
]
mypy_path = "src:packages/coordinax.api/src:packages/coordinax.astro/src:packages/coordinax.curveframes/src:packages/coordinax.hypothesis/src:packages/coordinax.interop.astropy/src"
namespace_packages = true
python_version = "3.11"
strict = true
warn_return_any = false
warn_unreachable = true
warn_unused_configs = true
[[tool.mypy.overrides]]
disallow_incomplete_defs = true
disallow_untyped_defs = true
module = "coordinax.*"
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
"array_api.*",
"quaxed.*",
"astropy.*",
"equinox.*",
"hypothesis.*",
"jax.*",
"coordinax.*",
"jaxtyping.*",
"numpy.*",
"quax.*",
]
[tool.pylint]
ignore-paths = [".*/_version.py", "scratch/.*"]
max-module-lines = 2000
messages_control.disable = [
"abstract-method", # pylint doesn't like ABC hierarchies
"arguments-differ", # plum-dispatch
"cyclic-import", # broken?
"design",
"duplicate-code",
"import-outside-toplevel", # handled by ruff
"fixme",
"function-redefined", # plum-dispatch
"invalid-name", # handled by ruff
"invalid-overridden-method",
"invalid-unary-operand-type", # pylint doesn't understand dataclass fields
"isinstance-second-argument-not-valid-type", # pylint doesn't understand classproperty objects
"line-too-long",
"missing-function-docstring", # TODO: resolve
"missing-kwoa", # plum-dispatch
"missing-module-docstring",
"no-member", # handled by mypy
"no-value-for-parameter", # pylint doesn't understand multiple dispatch
"not-a-mapping", # pylint doesn't understand dataclass fields
"not-an-iterable", # pylint doesn't understand dataclass fields
"property-with-parameters", # Cannot have defined parameters for properties
"protected-access", # handled by ruff
"redefined-builtin", # handled by ruff
"too-many-function-args", # plum-dispatch
"unexpected-keyword-arg", # plum-dispatch
"unnecessary-ellipsis", # I like my ellipses in ABCs and Protocols
"unnecessary-lambda", # jax uses lambdas frequently
"unnecessary-lambda-assignment", # jax uses lambdas frequently
"unsubscriptable-object", # handled by mypy
"unused-argument", # handled by ruff
"unused-wildcard-import", # handled by ruff
"wildcard-import", # handled by ruff
"wrong-import-position", # handled by ruff
"wrong-import-order", # handled by ruff
]
py-version = "3.11"
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
[tool.pytest.ini_options]
addopts = [
"--arraydiff",
"--ignore-glob=docs/spec.md", # exclude the spec file
"--import-mode=importlib",
"--showlocals",
"--strict-config",
"--strict-markers",
"-p no:doctest", # using sybil
"-ra", # Display extra test summary info for all outcomes
]
filterwarnings = [
"error",
"ignore:ast\\.Str is deprecated and will be removed in Python 3\\.14:DeprecationWarning", # from Sybil
"ignore:Attribute s is deprecated and will be removed in Python 3\\.14:DeprecationWarning", # from Sybil
"ignore:Explicitly requested dtype <class 'jax.numpy\\.float64'> requested in astype is not available",
"ignore:jax\\.main\\.get_aval is deprecated:DeprecationWarning",
"ignore:jax\\.main\\.pp_eqn_rules is deprecated:DeprecationWarning",
# hypothesis
"ignore:Do not use the `random` module inside strategies:hypothesis.errors.HypothesisDeprecationWarning",
]
log_level = "INFO"
markers = [
"network: marks tests that require a network connection (deselect with '-m not network')",
]
minversion = "8.3"
norecursedirs = [
".*", # ignores .hypothesis, .git, etc.
"__pycache__",
"docs/_build",
"docs/packages", # symlinks to package docs, don't test twice
]
pythonpath = ["tests"] # for importable test utility modules
testpaths = [
"README.md",
"packages/coordinax.api/",
"src/",
"docs/",
"tests/",
"packages/coordinax.astro",
"packages/coordinax.curveframes",
"packages/coordinax.hypothesis/",
"packages/coordinax.interop.astropy/",
]
xfail_strict = true
[tool.pytest_env]
COORDINAX_ENABLE_RUNTIME_TYPECHECKING = "beartype.beartype"
JAX_ENABLE_X64 = "1"
[tool.ty.src]
exclude = [
"tests",
"**/tests",
"**/tests/**",
"**/test_*.py",
"**/*_test.py",
".venv",
".nox",
".tox",
]
[tool.ruff]
namespace-packages = ["src/coordinax"]
[tool.ruff.lint]
extend-select = ["ALL"]
ignore = [
"A002", # Argument is shadowing a Python builtin
"ANN001", # Missing type annotation for `cls` in method
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"ARG001", # Unused function argument # TODO: resolve
"B008", # Do not perform function calls in argument defaults
"B024", # X is an ABC, but it has no abstract methods or properties
"COM812", # <- for ruff.format
"D103", # Missing docstring in public function # TODO: resolve
"D105", # Missing docstring in magic method
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"E731", # Do not assign a lambda expression, use a def
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable
"ERA001", # Commented out code
"F722", # Syntax error in forward annotation <- jaxtyping
"F811", # redefinition of unused '...' <- plum-dispatch
"F821", # undefined name '...' <- jaxtyping
"FIX002", # Line contains TODO
"ISC001", # Conflicts with formatter
"N802", # Function name should be lowercase
"N803", # Argument name should be lowercase
"N806", # Variable in function should be lowercase
"PD", # Pandas
"PLR09", # Too many <...>
"PLR2004", # Magic value used in comparison
"PYI041", # Use `complex` instead of `int | complex` <- plum is more strict
"RUF003", # Comment contains ambiguous symbol
"RUF022", # `__all__` is not sorted
"SLF001", # private-member-access TODO: unignore this.
"TC001", # Move into a type-checking block
"TD002", # Missing author in TODO
"TD003", # Missing issue link on the line following this TODO
"TRY003", # Avoid specifying long messages outside the exception class
]
[tool.ruff.lint.per-file-ignores]
"**/tests/**" = [
"ANN",
"ARG005", # Unused lambda argument
"D102",
"D401", # First line of docstring should be in imperative mood
"FBT001",
"INP001",
"N803",
"RUF002",
"S101",
"T20",
]
"__init__.py" = ["F403"]
"docs/conf.py" = ["A001", "INP001"]
"noxfile.py" = ["T20"]
"scripts/**" = ["INP001"]
[tool.ruff.lint.flake8-import-conventions.aliases]
"coordinax.angles" = "cxa"
"coordinax.api" = "cxapi"
"coordinax.astro" = "cxastro"
"coordinax.charts" = "cxc"
"coordinax.curveframes" = "cxfc"
"coordinax.distances" = "cxd"
"coordinax.frames" = "cxf"
"coordinax.hypothesis.angles" = "cxast"
"coordinax.hypothesis.astro" = "cxastrost"
"coordinax.hypothesis.charts" = "cxcst"
"coordinax.hypothesis.curveframes" = "cxfcst"
"coordinax.hypothesis.distances" = "cxdst"
"coordinax.hypothesis.frames" = "cxfst"
"coordinax.hypothesis.main" = "cxst"
"coordinax.hypothesis.manifolds" = "cxmst"
"coordinax.hypothesis.representations" = "cxrst"
"coordinax.hypothesis.transforms" = "cxfmst"
"coordinax.hypothesis.vectors" = "cxvst"
"coordinax.internal" = "cxi"
"coordinax.main" = "cx"
"coordinax.manifolds" = "cxm"
"coordinax.representations" = "cxr"
"coordinax.transforms" = "cxfm"
"coordinax.vectors" = "cxv"
equinox = "eqx"
functools = "ft"
unxt = "u"
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = [
"dataclassish",
"optional_dependencies",
"quaxed",
"unxt",
"unxt_hypothesis",
"xmmutablemap",
]
known-local-folder = ["coordinax"]
section-order = [
"future",
"standard-library",
"typing",
"third-party",
"first-party",
"local-folder",
]
sections = { typing = [
"typing",
"typing_extensions",
"types",
"collections.abc",
"jaxtyping",
] }
[tool.ty.rules]
invalid-argument-type = "ignore"
[tool.ty.terminal]
output-format = "concise"
[tool.uv]
# Temporary constraint to restrict JAX version
constraint-dependencies = ["numpy<2.4.0"]
[tool.uv.sources]
"coordinax.api" = { workspace = true }
"coordinax.astro" = { workspace = true }
"coordinax.curveframes" = { workspace = true }
"coordinax.hypothesis" = { workspace = true }
"coordinax.interop.astropy" = { workspace = true }
[tool.unxt]
quantity.repr.named_unit = false
quantity.repr.short_arrays = "compact"
quantity.repr.use_short_name = true
quantity.str.named_unit = true
quantity.str.short_arrays = false
quantity.str.use_short_name = true
[tool.uv.workspace]
members = ["packages/*"]