-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
181 lines (163 loc) · 5.07 KB
/
Copy pathpyproject.toml
File metadata and controls
181 lines (163 loc) · 5.07 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
[build-system]
# Lower bound: 1.27 is the first release with PEP 639 license metadata.
requires = ["hatchling>=1.27", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "pollux"
authors = [
{ name = "adrn", email = "adrian.prw@gmail.com" },
]
description = "A JAX framework for data-driven latent variable models, with models for stellar spectroscopy"
readme = "README.md"
license = "MIT"
license-files = ["LICENSE"]
requires-python = ">=3.12"
classifiers = [
"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.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
dynamic = ["version"]
# Runtime dependencies only: everything imported by pollux itself. Development
# tooling lives in [dependency-groups] below.
dependencies = [
"equinox>=0.11.12",
"jax>=0.7.2",
"jaxtyping>=0.3", # the array-shape aliases in pollux.typing
"numpyro>=0.19.0",
"tqdm>=4.67.1",
"typing-extensions>=4.15.0", # TypeIs; only in typing from 3.13
"xmmutablemap>=0.2.0",
]
# PEP 735 dependency groups. These are NOT published to PyPI: they are installed
# from a checkout, with `uv sync --only-group test` or, on pip >= 25.1,
# `pip install -e . --group test`.
[dependency-groups]
test = [
"pytest>=8.3",
"pytest-cov>=3",
]
docs = [
"astropy>=7.2.0",
"daft-pgm>=0.1.4", # probabilistic graphical models, imported as `daft`
"h5py>=3.16.0",
"ipykernel>=6.30.1",
"ipywidgets>=8.1.7",
"matplotlib>=3.10.8",
"myst-nb>=1.1.2",
"nbconvert>=7.17.0",
"rtds-action>=1.1.0",
"sphinx-book-theme==1.1.3",
"sphinx-prompt>=1.8.0",
"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",
]
dev = [
{include-group = "test"},
{include-group = "docs"},
"hatch",
"pre-commit",
"twine",
"ruff",
# ty is pre-1.0 and its rules still move between releases; uv.lock pins the
# exact version, so bump deliberately with `uv lock --upgrade-package ty`
"ty>=0.0.70,<0.1",
]
[project.urls]
Homepage = "https://github.com/adrn/pollux"
"Bug Tracker" = "https://github.com/adrn/pollux/issues"
Discussions = "https://github.com/adrn/pollux/discussions"
Changelog = "https://github.com/adrn/pollux/releases"
[tool.hatch]
version.source = "vcs"
build.hooks.vcs.version-file = "src/pollux/_version.py"
[tool.pytest.ini_options]
minversion = "8.3"
addopts = [
"-ra",
"--showlocals",
"--strict-markers",
"--strict-config",
"--doctest-modules",
]
xfail_strict = true
filterwarnings = [
"error",
"ignore:jax\\.core\\.call_p is deprecated:DeprecationWarning",
"ignore:jax\\.core\\.closed_call_p is deprecated:DeprecationWarning",
]
log_cli_level = "INFO"
testpaths = ["src", "docs", "tests"]
[tool.coverage]
run.source = ["pollux"]
report.exclude_also = [
'\.\.\.',
'if typing.TYPE_CHECKING:',
]
[tool.ty.src]
include = ["src"]
# numpyro ships no py.typed marker, so ty reads its source directly. That is why
# it catches real API misuse there that mypy could not see at all -- but it also
# means numpyro's internal TypeVars (DistributionT, ConstraintT) and the loose
# return type of numpyro.sample surface as false positives in the module that
# does the sampling.
[[tool.ty.overrides]]
include = ["src/pollux/models/lvm.py"]
rules = { invalid-argument-type = "ignore", invalid-assignment = "ignore" }
# equinox's field() is a dataclass field factory; ty reads the descriptor type
# rather than the field's declared type.
[[tool.ty.overrides]]
include = ["src/pollux/data/data.py"]
rules = { invalid-assignment = "ignore" }
[tool.ruff]
src = ["src"]
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
"NPY", # NumPy specific rules
"PD", # pandas-vet
]
ignore = [
"PLC0206", # Extracting value from dictionary without calling `.items()`
"PLR09", # Too many <...>
"PLR2004", # Magic value used in comparison
"ISC001", # Conflicts with formatter
"B905", # zip() without explicit strict
]
# isort.required-imports = []
# Uncomment if using a _compat.typing backport
# typing-modules = ["pollux._compat.typing"]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["T20", "F841", "RUF059"]
"**/__init__.py" = ["F401", "F403"]
"docs/**" = ["T201"]