Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
194 lines (181 loc) · 7.67 KB
/
Copy pathpyproject.toml
File metadata and controls
194 lines (181 loc) · 7.67 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
[build-system]
requires = ["setuptools>=70", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "aggregate"
# Written once, as the literal `__version__` in src/aggregate/__init__.py, and
# read from there by [tool.setuptools.dynamic]. A bump edits that one line and
# touches no environment.
dynamic = ["version"]
description = "Tools for creating and working with aggregate probability distributions."
readme = "README.md"
authors = [
{name = "Stephen J. Mildenhall", email = "mynl@me.com"},
]
maintainers = [
{name = "Stephen J. Mildenhall", email = "mynl@me.com"},
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Intended Audience :: Financial and Insurance Industry",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Education",
"Topic :: Office/Business :: Financial",
"Topic :: Scientific/Engineering :: Mathematics",
]
# greater_tables 6 requires Python >= 3.12 and floors numpy at 2.0 and pandas
# at 2.2, so making it a plain dependency at 1.0.0a229 raised this project's
# floors to match rather than leaving them to be inherited silently. It also
# brings pydantic and pyyaml in transitively.
dependencies = [
"greater_tables>=6",
"IPython",
"lark>=1.1",
"matplotlib>=3.5",
"numpy>=2.0",
"pandas>=2.2",
"Pygments",
# The exhibit format sheets (aggregate/formats/*.yaml) are parsed with
# yaml.safe_load. greater_tables already requires pyyaml, so this costs
# nothing to resolve, and it is declared here anyway because this package
# imports it: a transitive dependency that vanishes when greater_tables
# changes its own YAML library would break the sheets with a confusing
# error a long way from the cause.
"pyyaml>=6.0",
"scipy>=1.11",
# made optional in 0.27
# "numba",
]
license = "BSD-3-Clause"
requires-python = ">=3.12"
[project.urls]
Documentation = "https://aggregate.readthedocs.io/en/latest/"
"Source Code" = "https://github.com/mynl/aggregate"
[project.optional-dependencies]
dev = [
"myst-parser>=2.0",
"sphinx>=8.1,<9",
"docutils>=0.20,<0.22",
"nbsphinx>=0.9.4",
"jupyter-sphinx>=0.5.3",
"sphinx-copybutton>=0.5",
"sphinx-toggleprompt>=0.6",
"pickleshare",
# "recommonmark>=0.7.1",
# "setuptools>=62.3.2",
# "sphinx-panels",
# "sphinx-rtd-dark-mode",
"sphinx_rtd_theme>=2.0",
"sphinxcontrib-bibtex",
"sphinx-multitoc-numbering",
"pytest>=7",
"pytest-xdist>=3",
"pyarrow>=15",
"ruff>=0.6",
"hypothesis>=6",
]
notebook = [
"jupyterlab",
"ipywidgets",
"jupytext",
"attrs",
"ipython-autotime",
]
# Opt-in accelerator: numba-compiled TVaR / biTVaR inner loops in utilities.py.
# Pure-numpy fallbacks exist, so this is not required (numba was dropped as a
# hard dependency in 0.27). Declared here so it is an installable extra
# (`pip install aggregate[numba]` / `uv sync --extra numba`) rather than an
# undeclared package that a bare `uv sync` treats as removable.
numba = [
"numba",
]
# disk-backed (out-of-core) bivariate update -- dev/plan-bv.md. zarr 3 needs
# py >= 3.12, matching requires-python.
massive = [
"zarr>=3",
]
# Tier-2 interactive explorer for the massive bivariate (plan-bv §7.3).
viz = [
"datashader",
"holoviews",
"bokeh",
]
# Every user-facing extra in one shot. Self-referencing so the lists cannot
# drift; deliberately excludes `dev` (docs build and test tooling).
all = [
"aggregate[notebook,numba,massive,viz]",
]
# The exhibits IR (dev/plan-exhibits.md, [Exhibits-Module]) needs
# greater_tables 6, which published to PyPI on 2026-08-07. It is a plain
# dependency above rather than an `exhibits` extra: the exhibit surface is
# part of what the library is for, and an extra bought nothing once the
# package resolved normally. Developing greater_tables alongside this repo
# still works, but a `uv sync` will replace an editable checkout with the
# published wheel, so re-install it after syncing:
# UV_PROJECT_ENVIRONMENT=.venv uv pip install -e C:/S/AI/greatest-tables
[tool.setuptools]
include-package-data = true
package-dir = {"" = "src"}
# Read statically: setuptools parses the literal rather than importing the
# package, which would pull in pandas at build time.
[tool.setuptools.dynamic]
version = { attr = "aggregate.__version__" }
# uv caches a local project's metadata keyed on pyproject.toml alone. With the
# version dynamic it must also watch the file the version lives in, or a lock or
# an install can carry the previous number.
[tool.uv]
cache-keys = [{ file = "pyproject.toml" }, { file = "src/aggregate/__init__.py" }]
# Automatic discovery, NOT an explicit list. `packages = ["aggregate"]` names
# only the top level package: setuptools does not recurse, so the subpackages
# aggregate.charts, aggregate.exhibits and aggregate.plots were silently
# omitted from the wheel. That shipped an `aggregate` whose `.plot()` raised
# ModuleNotFoundError, and no test could see it, because the suite runs against
# the editable install where every module is present. A packaging bug is only
# visible from a built artifact, so this is verified by installing the wheel
# into a clean environment, not by pytest.
[tool.setuptools.packages.find]
where = ["src"]
include = ["aggregate*"]
[tool.setuptools.package-data]
aggregate = ["*.lark", "agg/*.agg", "data/*.mplstyle", "data/*.toml",
"data/decl-help/*.html", "formats/*.yaml"]
[tool.ruff]
# Linting only for now -- no whole-repo reformat (that would be a huge diff and
# collide with the in-flight numerics refactor). Run `uv run ruff check src`.
line-length = 100
[tool.ruff.lint]
# Start conservative: just pyflakes (unused imports/vars, bad f-strings, etc.).
# Deliberately NOT enabling pycodestyle E so the long-lined codebase doesn't
# drown in E501. Widen this set later if desired.
select = ["F"]
[tool.ruff.lint.per-file-ignores]
# The package __init__ intentionally re-exports submodule surfaces via `import *`.
"__init__.py" = ["F401", "F403"]
# distributions.py is a thin public facade over the underscore-prefixed kind
# modules (_fits / _frequency / _severity / _aggregate); it re-exports their
# surfaces via `import *`, so the star-import findings are expected, not bugs.
"distributions.py" = ["F401", "F403", "F405"]
[tool.pytest.ini_options]
testpaths = ["tests"]
# -n auto fans the suite across all cores (pytest-xdist); the workload is
# FFT/numpy-bound and parallelizes cleanly. Disable with `-n0` when you need a
# breakpoint/pdb or deterministic single-process ordering.
# -m 'not slow' is the fast-by-default local loop: the bleeding-edge bivariate
# suites (the multi-minute cases) are quarantined. Run EVERYTHING (gate/CI) with
# uv run pytest -m 'slow or not slow'
# --dist loadgroup keeps ungrouped tests distributed as before, but sends every
# test sharing an `xdist_group` name to ONE worker, so they run sequentially
# against each other. Used by the memory-heavy bivariate cases: several 2-D FFT
# grids allocated concurrently across workers could exhaust memory, which
# surfaced once as a numpy allocation failure in a test whose own grid is 64x64.
addopts = "-ra --strict-markers -n auto --dist loadgroup -m 'not slow'"
markers = [
"slow: bleeding-edge / multi-minute cases (bivariate, massive bivariate, reins bivariate). Deselected by default via addopts; run the full suite with `-m 'slow or not slow'`.",
"xdist_group: pin a set of tests to one xdist worker so they do not run concurrently with each other (memory-heavy 2-D FFT cases).",
]
[project.entry-points."pygments.lexers"]
lexer = "aggregate.decl_pygments:AggLexer"