bartz 0.5.0__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bartz-0.5.0 → bartz-0.7.0}/PKG-INFO +6 -5
- bartz-0.7.0/pyproject.toml +250 -0
- bartz-0.7.0/src/bartz/BART.py +813 -0
- {bartz-0.5.0 → bartz-0.7.0}/src/bartz/__init__.py +3 -3
- bartz-0.7.0/src/bartz/_version.py +1 -0
- bartz-0.7.0/src/bartz/debug.py +1364 -0
- bartz-0.7.0/src/bartz/grove.py +356 -0
- bartz-0.7.0/src/bartz/jaxext/__init__.py +213 -0
- bartz-0.7.0/src/bartz/jaxext/_autobatch.py +238 -0
- bartz-0.7.0/src/bartz/jaxext/scipy/__init__.py +25 -0
- bartz-0.7.0/src/bartz/jaxext/scipy/special.py +240 -0
- bartz-0.7.0/src/bartz/jaxext/scipy/stats.py +36 -0
- bartz-0.7.0/src/bartz/mcmcloop.py +668 -0
- bartz-0.7.0/src/bartz/mcmcstep.py +2616 -0
- bartz-0.7.0/src/bartz/prepcovars.py +254 -0
- bartz-0.5.0/pyproject.toml +0 -149
- bartz-0.5.0/src/bartz/BART.py +0 -510
- bartz-0.5.0/src/bartz/_version.py +0 -1
- bartz-0.5.0/src/bartz/debug.py +0 -184
- bartz-0.5.0/src/bartz/grove.py +0 -269
- bartz-0.5.0/src/bartz/jaxext.py +0 -374
- bartz-0.5.0/src/bartz/mcmcloop.py +0 -258
- bartz-0.5.0/src/bartz/mcmcstep.py +0 -1820
- bartz-0.5.0/src/bartz/prepcovars.py +0 -156
- {bartz-0.5.0 → bartz-0.7.0}/README.md +0 -0
- {bartz-0.5.0 → bartz-0.7.0}/src/bartz/.DS_Store +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bartz
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Super-fast BART (Bayesian Additive Regression Trees) in Python
|
|
5
5
|
Author: Giacomo Petrillo
|
|
6
6
|
Author-email: Giacomo Petrillo <info@giacomopetrillo.com>
|
|
7
7
|
License-Expression: MIT
|
|
8
|
-
Requires-Dist:
|
|
9
|
-
Requires-Dist:
|
|
10
|
-
Requires-Dist:
|
|
11
|
-
Requires-Dist:
|
|
8
|
+
Requires-Dist: equinox>=0.12.2
|
|
9
|
+
Requires-Dist: jax>=0.5.3
|
|
10
|
+
Requires-Dist: jaxtyping>=0.3.2
|
|
11
|
+
Requires-Dist: numpy>=1.25.2
|
|
12
|
+
Requires-Dist: scipy>=1.11.4
|
|
12
13
|
Requires-Python: >=3.10
|
|
13
14
|
Project-URL: Documentation, https://gattocrucco.github.io/bartz/docs-dev
|
|
14
15
|
Project-URL: Homepage, https://github.com/Gattocrucco/bartz
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# bartz/pyproject.toml
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2024-2025, Giacomo Petrillo
|
|
4
|
+
#
|
|
5
|
+
# This file is part of bartz.
|
|
6
|
+
#
|
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
# furnished to do so, subject to the following conditions:
|
|
13
|
+
#
|
|
14
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
# copies or substantial portions of the Software.
|
|
16
|
+
#
|
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
# SOFTWARE.
|
|
24
|
+
|
|
25
|
+
[build-system]
|
|
26
|
+
requires = ["uv_build>=0.7.3,<0.8.0"]
|
|
27
|
+
build-backend = "uv_build"
|
|
28
|
+
|
|
29
|
+
[project]
|
|
30
|
+
name = "bartz"
|
|
31
|
+
version = "0.7.0"
|
|
32
|
+
description = "Super-fast BART (Bayesian Additive Regression Trees) in Python"
|
|
33
|
+
authors = [
|
|
34
|
+
{name = "Giacomo Petrillo", email = "info@giacomopetrillo.com"},
|
|
35
|
+
]
|
|
36
|
+
license = "MIT"
|
|
37
|
+
readme = "README.md"
|
|
38
|
+
requires-python = ">=3.10"
|
|
39
|
+
dependencies = [
|
|
40
|
+
"equinox>=0.12.2",
|
|
41
|
+
"jax>=0.5.3",
|
|
42
|
+
"jaxtyping>=0.3.2",
|
|
43
|
+
"numpy>=1.25.2",
|
|
44
|
+
"scipy>=1.11.4",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[project.urls]
|
|
48
|
+
Homepage = "https://github.com/Gattocrucco/bartz"
|
|
49
|
+
Documentation = "https://gattocrucco.github.io/bartz/docs-dev"
|
|
50
|
+
Issues = "https://github.com/Gattocrucco/bartz/issues"
|
|
51
|
+
|
|
52
|
+
[dependency-groups]
|
|
53
|
+
only-local = [
|
|
54
|
+
"appnope>=0.1.4",
|
|
55
|
+
"ipython>=8.36.0",
|
|
56
|
+
"matplotlib>=3.10.3",
|
|
57
|
+
"matplotlib-label-lines>=0.8.1",
|
|
58
|
+
"pre-commit>=4.2.0",
|
|
59
|
+
"pydoclint>=0.6.6",
|
|
60
|
+
"ruff>=0.11.9",
|
|
61
|
+
"scikit-learn>=1.6.1",
|
|
62
|
+
"tomli>=2.2.1",
|
|
63
|
+
"virtualenv>=20.31.2",
|
|
64
|
+
"xgboost>=3.0.0",
|
|
65
|
+
]
|
|
66
|
+
ci = [
|
|
67
|
+
"asv>=0.6.4",
|
|
68
|
+
"coverage>=7.8.0",
|
|
69
|
+
"myst-parser>=4.0.1",
|
|
70
|
+
"packaging>=25.0",
|
|
71
|
+
"polars[pandas,pyarrow]>=1.29.0",
|
|
72
|
+
"pytest>=8.3.5",
|
|
73
|
+
"pytest-timeout>=2.4.0",
|
|
74
|
+
"sphinx>=8.1.3",
|
|
75
|
+
"sphinx-autodoc-typehints>=3.0.1",
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
[tool.pytest.ini_options]
|
|
79
|
+
cache_dir = "config/pytest_cache"
|
|
80
|
+
testpaths = ["tests"]
|
|
81
|
+
addopts = [
|
|
82
|
+
"-r xXfE",
|
|
83
|
+
"--pdbcls=IPython.terminal.debugger:TerminalPdb",
|
|
84
|
+
"--durations=3",
|
|
85
|
+
"--verbose",
|
|
86
|
+
"--import-mode=importlib",
|
|
87
|
+
]
|
|
88
|
+
timeout = 256
|
|
89
|
+
timeout_method = "thread" # when jax hangs, signals do not work
|
|
90
|
+
|
|
91
|
+
[tool.coverage.run]
|
|
92
|
+
branch = true
|
|
93
|
+
source = ["bartz"]
|
|
94
|
+
|
|
95
|
+
[tool.coverage.report]
|
|
96
|
+
show_missing = true
|
|
97
|
+
|
|
98
|
+
[tool.coverage.html]
|
|
99
|
+
show_contexts = true
|
|
100
|
+
directory = "_site/coverage"
|
|
101
|
+
|
|
102
|
+
[tool.coverage.paths]
|
|
103
|
+
# the first path in each list must be the source directory in the machine that's
|
|
104
|
+
# generating the coverage report
|
|
105
|
+
|
|
106
|
+
github = [
|
|
107
|
+
'/home/runner/work/bartz/bartz/src/bartz/',
|
|
108
|
+
'/Users/runner/work/bartz/bartz/src/bartz/',
|
|
109
|
+
'D:\a\bartz\bartz\src\bartz\',
|
|
110
|
+
'/Library/Frameworks/Python.framework/Versions/*/lib/python*/site-packages/bartz/',
|
|
111
|
+
'/Users/runner/hostedtoolcache/Python/*/*/lib/python*/site-packages/bartz/',
|
|
112
|
+
'/opt/hostedtoolcache/Python/*/*/lib/python*/site-packages/bartz/',
|
|
113
|
+
'C:\hostedtoolcache\windows\Python\*\*\Lib\site-packages\bartz\',
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
local = [
|
|
117
|
+
'src/bartz/',
|
|
118
|
+
'/home/runner/work/bartz/bartz/src/bartz/',
|
|
119
|
+
'/Users/runner/work/bartz/bartz/src/bartz/',
|
|
120
|
+
'D:\a\bartz\bartz\src\bartz\',
|
|
121
|
+
'/Library/Frameworks/Python.framework/Versions/*/lib/python*/site-packages/bartz/',
|
|
122
|
+
'/Users/runner/hostedtoolcache/Python/*/*/lib/python*/site-packages/bartz/',
|
|
123
|
+
'/opt/hostedtoolcache/Python/*/*/lib/python*/site-packages/bartz/',
|
|
124
|
+
'C:\hostedtoolcache\windows\Python\*\*\Lib\site-packages\bartz\',
|
|
125
|
+
]
|
|
126
|
+
|
|
127
|
+
[tool.ruff]
|
|
128
|
+
exclude = [".asv", "*.ipynb"]
|
|
129
|
+
cache-dir = "config/ruff_cache"
|
|
130
|
+
|
|
131
|
+
[tool.ruff.format]
|
|
132
|
+
quote-style = "single"
|
|
133
|
+
skip-magic-trailing-comma = true
|
|
134
|
+
|
|
135
|
+
[tool.ruff.lint.isort]
|
|
136
|
+
split-on-trailing-comma = false
|
|
137
|
+
|
|
138
|
+
[tool.ruff.lint]
|
|
139
|
+
select = [
|
|
140
|
+
"ERA", # eradicate
|
|
141
|
+
"S", # flake8-bandit
|
|
142
|
+
"BLE", # flake8-blind-except
|
|
143
|
+
"B", # bugbear
|
|
144
|
+
"A", # flake8-builtins
|
|
145
|
+
"C4", # flake8-comprehensions
|
|
146
|
+
"CPY", # flake8-copyright
|
|
147
|
+
"DTZ", # flake8-datetimez
|
|
148
|
+
"T10", # flake8-debugger
|
|
149
|
+
"EM", # flake8-errmsg
|
|
150
|
+
"EXE", # flake8-executable
|
|
151
|
+
"FIX", # flake8-fixme
|
|
152
|
+
"ISC", # flake8-implicit-str-concat
|
|
153
|
+
"INP", # flake8-no-pep420
|
|
154
|
+
"PIE", # flake8-pie
|
|
155
|
+
"T20", # flake8-print
|
|
156
|
+
"PT", # flake8-pytest-style
|
|
157
|
+
"RSE", # flake8-raise
|
|
158
|
+
"RET", # flake8-return
|
|
159
|
+
"SLF", # flake8-self
|
|
160
|
+
"SIM", # flake8-simplify
|
|
161
|
+
"TID", # flake8-tidy-imports
|
|
162
|
+
"ARG", # flake8-unused-arguments
|
|
163
|
+
"PTH", # flake8-use-pathlib
|
|
164
|
+
"FLY", # flynt
|
|
165
|
+
"I", # isort
|
|
166
|
+
"C90", # mccabe
|
|
167
|
+
"NPY", # NumPy-specific rules
|
|
168
|
+
"PERF", # Perflint
|
|
169
|
+
"W", # pycodestyle Warning
|
|
170
|
+
"F", # pyflakes
|
|
171
|
+
"D", # pydocstyle
|
|
172
|
+
"PGH", # pygrep-hooks
|
|
173
|
+
"PLC", # Pylint Convention
|
|
174
|
+
"PLE", # Pylint Error
|
|
175
|
+
"PLR", # Pylint Refactor
|
|
176
|
+
"PLW", # Pyling Warning
|
|
177
|
+
"UP", # pyupgrade
|
|
178
|
+
"FURB", # refurb
|
|
179
|
+
"RUF", # Ruff-specific rules
|
|
180
|
+
"TRY", # tryceratops
|
|
181
|
+
]
|
|
182
|
+
ignore = [
|
|
183
|
+
"B028", # warn with stacklevel = 2
|
|
184
|
+
"C408", # Unnecessary `dict()` call (rewrite as a literal), it's too convenient for kwargs
|
|
185
|
+
"D105", # Missing docstring in magic method
|
|
186
|
+
"F722", # Syntax error in forward annotation. I ignore this because jaxtyping uses strings for shapes instead of for deferred annotations.
|
|
187
|
+
"PIE790", # Unnecessary ... or pass. Ignored because sometimes I use ... as sentinel to tell the rest of ruff and pyright that an implementation is a stub.
|
|
188
|
+
"PLR0913", # Too many arguments in function definition. Maybe I should do something about this?
|
|
189
|
+
"PLR2004", # Magic value used in comparison, consider replacing `*` with a constant variable
|
|
190
|
+
"RET505", # Unnecessary `{branch}` after `return` statement. I ignore this because I like to keep branches for readability.
|
|
191
|
+
"RET506", # Unnecessary `else` after `raise` statement. I ignore this because I like to keep branches for readability.
|
|
192
|
+
"S101", # Use of `assert` detected. Too annoying.
|
|
193
|
+
"S603", # `subprocess` call: check for execution of untrusted input. Too many false positives.
|
|
194
|
+
"SIM108", # SIM108 Use ternary operator `*` instead of `if`-`else`-block, I find blocks more readable
|
|
195
|
+
"UP037", # Remove quotes from type annotation. Ignore because jaxtyping.
|
|
196
|
+
]
|
|
197
|
+
|
|
198
|
+
[tool.ruff.lint.per-file-ignores]
|
|
199
|
+
"{config/*,docs/*}" = [
|
|
200
|
+
"D100", # Missing docstring in public module
|
|
201
|
+
"D101", # Missing docstring in public class
|
|
202
|
+
"D102", # Missing docstring in public method
|
|
203
|
+
"D103", # Missing docstring in public function
|
|
204
|
+
"D104", # Missing docstring in public package
|
|
205
|
+
"INP001", # File * is part of an implicit namespace package. Add an `__init__.py`.
|
|
206
|
+
]
|
|
207
|
+
"src/bartz/_version.py" = [
|
|
208
|
+
"CPY001", # Missing copyright notice at top of file
|
|
209
|
+
]
|
|
210
|
+
"{config/*,docs/*,tests/*}" = [
|
|
211
|
+
"T201", # `print` found
|
|
212
|
+
]
|
|
213
|
+
"{tests/*,benchmarks/*}" = [
|
|
214
|
+
"SLF001", # Private member accessed: `*`
|
|
215
|
+
"TID253", # `{module}` is banned at the module level
|
|
216
|
+
]
|
|
217
|
+
"docs/conf.py" = [
|
|
218
|
+
"S607", # Starting a process with a partial executable path. Ignored because for a build script it makes more sense to use PATH.
|
|
219
|
+
]
|
|
220
|
+
|
|
221
|
+
[tool.ruff.lint.pydocstyle]
|
|
222
|
+
convention = "numpy"
|
|
223
|
+
|
|
224
|
+
[tool.ruff.lint.flake8-copyright]
|
|
225
|
+
min-file-size = 1
|
|
226
|
+
|
|
227
|
+
[tool.ruff.lint.flake8-tidy-imports]
|
|
228
|
+
banned-module-level-imports = ["bartz.debug"]
|
|
229
|
+
ban-relative-imports = "all"
|
|
230
|
+
|
|
231
|
+
[tool.pydoclint]
|
|
232
|
+
baseline = "config/pydoclint-baseline.txt"
|
|
233
|
+
auto-regenerate-baseline = false
|
|
234
|
+
# auto-regenerate = false because in pre-commit pydoclint does not see the
|
|
235
|
+
# unmodified files, thinks those errors are gone, and removes them from the
|
|
236
|
+
# baseline.
|
|
237
|
+
arg-type-hints-in-signature = true
|
|
238
|
+
arg-type-hints-in-docstring = false
|
|
239
|
+
check-return-types = false
|
|
240
|
+
check-yield-types = false
|
|
241
|
+
treat-property-methods-as-class-attributes = true
|
|
242
|
+
check-style-mismatch = true
|
|
243
|
+
show-filenames-in-every-violation-message = true
|
|
244
|
+
check-class-attributes = false
|
|
245
|
+
# do not check class attributes because in dataclasses I document them as
|
|
246
|
+
# init parameters because they are duplicated otherwise.
|
|
247
|
+
|
|
248
|
+
[tool.uv]
|
|
249
|
+
python-downloads = "never"
|
|
250
|
+
python-preference = "only-system"
|