-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
345 lines (311 loc) · 10.4 KB
/
pyproject.toml
File metadata and controls
345 lines (311 loc) · 10.4 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
[project]
authors = [
{ name = "GalacticDynamics", email = "nstarman@users.noreply.github.com" },
{ name = "Nathaniel Starkman", email = "nstarman@users.noreply.github.com" },
]
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.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
dependencies = [
"equinox>=0.13.5",
"jax>=0.7.2",
"jaxmore>=0.2.0",
"jax-tqdm>=0.4.0",
"jaxtyping>=0.3.5",
"optax>=0.2.4",
"optional-dependencies>=0.4.0",
"plum-dispatch>=2.6.1",
"quax>=0.2.1",
"zeroth>=1.0.1",
]
description = "Walk through phase-space observations"
dynamic = ["version"]
license.file = "LICENSE"
name = "phasecurvefit"
readme = "README.md"
requires-python = ">=3.12"
[project.optional-dependencies]
all = ["phasecurvefit[interop,kdtree]"]
interop = ["unxt>=1.10.4"]
kdtree = ["jaxkd>=0.0.5"]
[project.urls]
"Bug Tracker" = "https://github.com/GalacticDynamics/phasecurvefit/issues"
Changelog = "https://github.com/GalacticDynamics/phasecurvefit/releases"
Homepage = "https://github.com/GalacticDynamics/phasecurvefit"
[build-system]
build-backend = "hatchling.build"
requires = ["hatch-vcs", "hatchling"]
[dependency-groups]
dev = [
"ipykernel>=7.1.0",
"matplotlib>=3.10.8",
{ include-group = "docs" },
{ include-group = "lint" },
{ include-group = "nox" },
{ include-group = "test" },
"ipywidgets>=8.1.8",
"cz-conventional-gitmoji>=0.7.0",
"commitizen>=4.11.3",
]
docs = [
"myst-parser>=4.0.0",
"nbsphinx>=0.9.3",
"pytz>=2024.2",
"sphinx>=8.1.3",
"sphinx-autobuild>=2024.10.3",
"sphinx-autodoc-typehints>=2.6.1",
"sphinx-book-theme>=1.1.3",
"sphinx-copybutton>=0.5.2",
"sphinx-design>=0.6.1",
"sphinx-prompt>=1.9.0",
"sphinx-togglebutton>=0.3.2",
"sphinxcontrib-bibtex>=2.6.3",
"sphinxext-opengraph>=0.9.2",
"jaxkd>=0.0.5",
"galax",
]
lint = ["cz-conventional-gitmoji>=0.6.1", "pre-commit>=4.1.0", "pylint>=3.3.8"]
nox = ["nox>=2024.10.9", "nox-uv>=0.6.3"]
test = [
"beartype>=0.21.0",
"hypothesis[numpy]>=6.138.14",
"matplotlib>=3.8",
"pytest>=9.0.2",
"pytest-arraydiff>=0.6.1",
"pytest-benchmark>=5.1.0",
"pytest-codspeed>=4.2.0",
"pytest-cov>=6.2.1",
"pytest-env>=1.1.5",
"pytest-github-actions-annotate-failures>=0.3.0",
"pytest-mpl>=0.17.0",
"pytest-randomly>=3.16.0",
"pytest-timeout>=2.3.1",
"sybil[pytest]>=8.0.0",
"unxt>=1.10.4",
"jaxkd>=0.0.5",
]
[tool.hatch]
build.hooks.vcs.version-file = "src/phasecurvefit/_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}
"""
version.source = "vcs"
[tool.hatch.version.raw-options]
local_scheme = "no-local-version"
[tool.codespell]
ignore-words-list = "leary"
skip = ["uv.lock", "*.ipynb"]
[tool.commitizen]
name = "cz_gitmoji"
[tool.ruff]
[tool.ruff.lint]
extend-select = ["ALL"]
ignore = [
"A002", # Argument is shadowing a Python builtin
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"ARG001", # Unused function argument
"COM812", # <- for ruff.format
"D103", # Missing docstring in public function
"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
"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
"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
"RUF022", # `__all__` is not sorted
"TD002", # Missing author in TODO
"TD003", # Missing issue link on the line following this TODO
]
[tool.ruff.lint.per-file-ignores]
"*.ipynb" = ["ANN", "FBT003", "N803", "T201"]
"**tests/**" = [
"ANN",
"E731",
"INP001",
"N803",
"PLC0415",
"RUF059",
"S101",
"SLF001",
"T20",
]
"__init__.py" = ["F403"]
"conftest.py" = ["ANN", "PLC0415"]
"docs/**" = ["N803", "T201"]
"docs/conf.py" = ["A001", "INP001", "T201"]
"noxfile.py" = ["A001", "T20"]
"src/phasecurvefit/_src/algorithm.py" = [
"FBT003", # Boolean literal in function call is clearer than named constant
"PYI025", # Set from collections.abc is clear in context
"RUF059", # Unpacked tuple elements required for JAX while loop state
]
"src/phasecurvefit/_src/autoencoder.py" = [
"ANN001", # Missing type annotations for nested loss functions
"ANN202", # Missing return type for nested loss functions
"C901", # train_autoencoder is complex but well-structured
"RUF003", # Greek letters are intentional in math code
"RUF059", # Unpacked variable 'keys' used for structure
]
"src/phasecurvefit/_src/phasespace.py" = [
"UP040", # TypeAlias is more explicit for Python 3.12
]
"src/phasecurvefit/_version.py" = ["ALL"]
[tool.ruff.lint.flake8-import-conventions.aliases]
equinox = "eqx"
"hypothesis.strategies" = "st"
"jax.numpy" = "jnp"
phasecurvefit = "pcf"
[tool.ruff.lint.isort]
combine-as-imports = true
extra-standard-library = ["typing_extensions"]
known-first-party = [
"dataclassish",
"is_annotated",
"jaxmore",
"optional_dependencies",
"quaxed",
"unxt",
"zeroth",
]
known-local-folder = ["phasecurvefit"]
[tool.ruff.format]
docstring-code-format = true
[tool.coverage]
report.exclude_also = [
'\.\.\.',
'if typing.TYPE_CHECKING:',
'if TYPE_CHECKING:',
]
run.branch = true
run.source = ["phasecurvefit"]
[tool.mypy]
disallow_incomplete_defs = false
disallow_untyped_defs = false
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
files = ["src", "tests"]
python_version = "3.12"
strict = true
warn_return_any = false
warn_unreachable = true
warn_unused_configs = true
[[tool.mypy.overrides]]
disable_error_code = ["name-defined", "no-redef", "type-arg"]
disallow_incomplete_defs = true
disallow_untyped_defs = true
module = "phasecurvefit.*"
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
"equinox.*",
"flax.*",
"hypothesis.*",
"jax.*",
"jax_tqdm.*",
"jaxtyping.*",
"numpy.*",
"optax.*",
"plum.*",
"unxt.*",
"zeroth.*",
]
[tool.pylint]
ignore-paths = [".*/_version.py"]
messages_control.disable = [
"cyclic-import",
"design",
"duplicate-code", # Expected for public re-exports
"fixme",
"abstract-method",
"function-redefined", # plum-dispatch
"import-error", # Optional dependencies handled via OptionalDependencyEnum
"invalid-name", # handled by ruff
"line-too-long",
"missing-function-docstring",
"missing-kwoa", # plum-dispatch
"missing-module-docstring",
"no-value-for-parameter", # plum-dispatch
"not-callable", # handled by mypy
"property-with-parameters", # handled by ruff
"protected-access", # handled by ruff
"redefined-builtin", # handled by ruff
"too-many-function-args", # plum-dispatch
"unexpected-keyword-arg", # plum-dispatch
"unnecessary-lambda-assignment", # Intentional for clarity in some cases
"unused-argument", # handled by ruff
"unused-import", # handled by ruff
"unused-variable", # handled by ruff
"unused-wildcard-import", # handled by ruff
"wildcard-import", # handled by ruff
"wrong-import-order", # handled by ruff
"wrong-import-position",
"W0221", # Arguments in function call differ from overridden method
]
py-version = "3.12"
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
[tool.pylint."FORMAT"]
max-module-lines = 2000
[tool.pytest.ini_options]
addopts = [
"--arraydiff",
"--showlocals",
"--strict-config",
"--strict-markers",
"-p no:doctest", # using sybil
"-ra",
"--timeout=300", # 5 minute timeout per test
"--randomly-seed=0", # Deterministic by default, but randomizes test order
"--randomly-dont-reorganize", # Keep test class/module structure, only shuffle within
"--ignore=tests/benchmarks/", # Exclude benchmark tests from normal runs
"--mpl-hash-library=tests/usage/baseline_hashes.json",
]
filterwarnings = [
"error",
# pytest
"ignore:The hookimpl.*uses old-style configuration options:pytest.PytestDeprecationWarning",
# jax (restrict to relevant modules: equinox and jax use these deprecated APIs)
"ignore:jax\\.core\\.pp_eqn_rules is deprecated:DeprecationWarning:(jax|equinox)(\\.|_)",
"ignore:jax\\._src\\.interpreters\\.mlir\\.Primitive is deprecated:DeprecationWarning:(jax|equinox)(\\.|_)",
"ignore:jax\\.core\\.mapped_aval is deprecated:DeprecationWarning:(jax|equinox)(\\.|_)",
"ignore:jax\\.core\\.unmapped_aval is deprecated:DeprecationWarning:(jax|equinox)(\\.|_)",
"ignore:jax\\.core\\.NotMapped is deprecated:DeprecationWarning:(jax|equinox)(\\.|_)",
"ignore:The numpy\\.array_function protocol:DeprecationWarning",
"ignore:numpy\\.ndarray size changed:RuntimeWarning",
# matplotlib
"ignore::DeprecationWarning:matplotlib",
# numpy (platform-specific longdouble probe warning during import)
"ignore:Signature .* for <class 'numpy\\.longdouble'> does not match any known type:UserWarning:numpy\\._core\\.getlimits",
]
log_level = "INFO"
minversion = "8.3"
norecursedirs = [".*", "__pycache__", "docs/_build"]
testpaths = ["README.md", "docs", "src/", "tests/"]
xfail_strict = true
[tool.pytest_env]
PHASECURVEFIT_ENABLE_RUNTIME_TYPECHECKING = "beartype.beartype"
[tool.repo-review]
ignore = ["PC140"]
[tool.uv.sources]
galax = { git = "https://github.com/GalacticDynamics/galax" }