psyphy 0.0.4__tar.gz → 0.0.5__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.
Files changed (64) hide show
  1. psyphy-0.0.5/.gitignore +51 -0
  2. psyphy-0.0.5/CHANGELOG.md +121 -0
  3. {psyphy-0.0.4 → psyphy-0.0.5}/PKG-INFO +26 -5
  4. {psyphy-0.0.4 → psyphy-0.0.5}/README.md +11 -0
  5. {psyphy-0.0.4 → psyphy-0.0.5}/pyproject.toml +43 -2
  6. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/__init__.py +2 -1
  7. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/data/__init__.py +3 -1
  8. psyphy-0.0.5/src/psyphy/data/dataset.py +425 -0
  9. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/data/io.py +19 -10
  10. psyphy-0.0.5/src/psyphy/data/published/__init__.py +30 -0
  11. psyphy-0.0.5/src/psyphy/data/published/hong2025.py +861 -0
  12. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/inference/map_optimizer.py +133 -5
  13. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/model/likelihood.py +257 -45
  14. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/model/prior.py +13 -2
  15. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/model/wppm.py +21 -5
  16. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/posterior/__init__.py +6 -1
  17. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/posterior/parameter_posterior.py +1 -2
  18. psyphy-0.0.5/src/psyphy/posterior/predictive_posterior.py +561 -0
  19. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/trial_placement/__init__.py +2 -0
  20. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/trial_placement/grid.py +5 -6
  21. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/trial_placement/sobol.py +14 -0
  22. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/utils/math.py +0 -4
  23. psyphy-0.0.5/src/psyphy/viz/__init__.py +40 -0
  24. psyphy-0.0.5/src/psyphy/viz/ellipses.py +252 -0
  25. psyphy-0.0.5/src/psyphy/viz/geometry.py +170 -0
  26. {psyphy-0.0.4 → psyphy-0.0.5}/tests/test_3stimulus_decision_rule.py +24 -17
  27. {psyphy-0.0.4 → psyphy-0.0.5}/tests/test_covariance_field.py +1 -1
  28. psyphy-0.0.5/tests/test_data_format.py +285 -0
  29. psyphy-0.0.5/tests/test_data_published_hong2025.py +403 -0
  30. psyphy-0.0.5/tests/test_docs_recipe.py +136 -0
  31. {psyphy-0.0.4 → psyphy-0.0.5}/tests/test_imports.py +1 -0
  32. psyphy-0.0.5/tests/test_input_dim_validation.py +85 -0
  33. psyphy-0.0.5/tests/test_likelihood_logic.py +119 -0
  34. psyphy-0.0.5/tests/test_map_optimizer_clipping.py +110 -0
  35. {psyphy-0.0.4 → psyphy-0.0.5}/tests/test_mc_likelihood.py +94 -58
  36. {psyphy-0.0.4 → psyphy-0.0.5}/tests/test_model_api.py +14 -11
  37. {psyphy-0.0.4 → psyphy-0.0.5}/tests/test_noise_models.py +2 -6
  38. psyphy-0.0.5/tests/test_posteriors.py +405 -0
  39. psyphy-0.0.5/tests/test_quick_start_recovery.py +207 -0
  40. psyphy-0.0.5/tests/test_viz.py +203 -0
  41. {psyphy-0.0.4 → psyphy-0.0.5}/tests/test_wishart_covariance.py +3 -2
  42. psyphy-0.0.4/.gitignore +0 -33
  43. psyphy-0.0.4/src/psyphy/data/dataset.py +0 -303
  44. psyphy-0.0.4/src/psyphy/posterior/predictive_posterior.py +0 -287
  45. psyphy-0.0.4/tests/test_input_dim_validation.py +0 -38
  46. psyphy-0.0.4/tests/test_posteriors.py +0 -236
  47. {psyphy-0.0.4 → psyphy-0.0.5}/LICENSE.md +0 -0
  48. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/inference/__init__.py +0 -0
  49. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/inference/base.py +0 -0
  50. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/inference/langevin.py +0 -0
  51. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/inference/laplace.py +0 -0
  52. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/model/__init__.py +0 -0
  53. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/model/base.py +0 -0
  54. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/model/covariance_field.py +0 -0
  55. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/model/noise.py +0 -0
  56. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/posterior/posterior.py +0 -0
  57. {psyphy-0.0.4 → psyphy-0.0.5}/src/psyphy/utils/__init__.py +0 -0
  58. {psyphy-0.0.4 → psyphy-0.0.5}/tests/conftest.py +0 -0
  59. {psyphy-0.0.4 → psyphy-0.0.5}/tests/test_basis_input_domain.py +0 -0
  60. {psyphy-0.0.4 → psyphy-0.0.5}/tests/test_covariance_field_single_entry_point.py +0 -0
  61. {psyphy-0.0.4 → psyphy-0.0.5}/tests/test_covariance_positive_definite.py +0 -0
  62. {psyphy-0.0.4 → psyphy-0.0.5}/tests/test_embedding_dim.py +0 -0
  63. {psyphy-0.0.4 → psyphy-0.0.5}/tests/test_rectangular_U.py +0 -0
  64. {psyphy-0.0.4 → psyphy-0.0.5}/tests/test_wppm_model_kwargs_guard.py +0 -0
@@ -0,0 +1,51 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .pytest_cache/
4
+ .mypy_cache/
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ .venv/
9
+
10
+ *.sh
11
+
12
+ # MkDocs build output and caches
13
+ site/
14
+ .cache/
15
+ .mkdocs-cache/
16
+
17
+ # Ignore apple macOS system files
18
+ .DS_Store
19
+ # Ignore Jupyter Notebook checkpoints
20
+ .ipynb_checkpoints
21
+
22
+ # Ignore VSCode settings
23
+ .vscode/
24
+
25
+ # Generated plot output directories
26
+ # docs/examples/**/plots/*
27
+
28
+ # common Python tooling artifacts
29
+ .ruff_cache/
30
+ .coverage
31
+ coverage.xml
32
+ htmlcov/
33
+ .env
34
+ env/
35
+ venv/
36
+ .python-version
37
+
38
+
39
+
40
+
41
+
42
+ # docs/examples/wppm/hong2025_reproduction.md
43
+
44
+ docs/examples/wppm/plots/hong2025_quick_ellipses.png
45
+ docs/examples/wppm/plots/hong2025_quick_learning_curve.png
46
+ docs/examples/wppm/plots/hong2025_quick_thresholds_end_to_end.png
47
+
48
+ # Saved weights from stage 3. Quick-mode fits are smoke-test noise; the
49
+ # full-mode .npz is ~2 KB and worth committing, since it lets anyone
50
+ # regenerate the end-to-end figure without a GPU.
51
+ docs/examples/wppm/fits/hong2025_quick_fit.npz
@@ -0,0 +1,121 @@
1
+ # Changelog
2
+
3
+ All notable changes to `psyphy` are documented here.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `psyphy` is
6
+ pre-1.0: while the version is `0.0.x`, **any release may change the public API**, so
7
+ breaking changes are called out below but do not force a minor-version bump.
8
+
9
+ ## [0.0.5] — 2026-10-09
10
+
11
+ Two new subpackages
12
+ (`psyphy.viz`, `psyphy.data.published`), a reproduction of a published figure, and two
13
+ breaking API changes in the model layer.
14
+
15
+ ### Breaking
16
+
17
+ - **`TaskLikelihood.predict` signature and return type changed** (#139). Stimuli are now
18
+ passed as one packed, slot-indexed array instead of separate arguments, and the return
19
+ is a tuple of sufficient statistics instead of a bare scalar:
20
+
21
+ ```python
22
+ # before (0.0.4)
23
+ def predict(self, params, ref, comparison, model, *, key=None) -> jnp.ndarray: ...
24
+ # returns p_correct
25
+
26
+ # now (0.0.5)
27
+ def predict(self, params, stimuli, model, *, key=None) -> tuple[jnp.ndarray, ...]: ...
28
+ # stimuli has shape (K, input_dim); OddityTask reads stimuli[0], stimuli[1]
29
+ # returns (p_correct,) for Bernoulli tasks, (mu, sigma) for Gaussian task likelihoods
30
+ ```
31
+
32
+ **If you wrote a custom `TaskLikelihood`, it must be updated.** Unpack `stimuli`
33
+ yourself and wrap the return in a tuple. Returning a bare array no longer works
34
+ correctly: `BernoulliTaskLikelihood.loglik` indexes element 0 of the returned tuple, so
35
+ a bare scalar silently collapses every trial onto the first trial's probability.
36
+
37
+ - **`TrialData` now stores stimuli as one array** (#136). `refs=` / `comparisons=` are
38
+ replaced by a single `stimuli` array of shape `(N, K, d)`, with `responses` of shape
39
+ `(N, R)`; `K` is the number of stimuli per trial, so tasks with more than two slots are
40
+ now representable.
41
+
42
+ ```python
43
+ # before
44
+ TrialData(refs=refs, comparisons=comparisons, responses=responses)
45
+ # now
46
+ TrialData(stimuli=jnp.stack([refs, comparisons], axis=1), responses=responses)
47
+ ```
48
+
49
+ A 1-D `responses` array of shape `(N,)` is still accepted and normalized to `(N, 1)`.
50
+ Slots may optionally be named, e.g., `stimulus_names=("ref", "comp")` enables
51
+ `data.stimulus("ref")` alongside positional `data.stimuli[:, 0, :]`.
52
+
53
+ **For the oddity task, `K` is 2, not 3.** The observer is shown three stimuli, but only
54
+ the two distinct means are stored; presenting the reference twice is encoded in
55
+ `OddityTask`, which draws two samples from the reference distribution and one from the
56
+ comparison. `K` counts stored stimuli, not presentations.
57
+
58
+ ### Added
59
+
60
+ - **`psyphy.data.published`** loaders for published datasets, starting with
61
+ `hong2025`: `fetch`, `fetch_calibration_matrix`, `load_calibration_matrix`,
62
+ `load_trials`, `load_reference_W`, `load_sigma_table`, `build_paper_model`,
63
+ `w2d_to_rgb`, `default_data_dir`. Datasets are downloaded on demand (resumable, cached
64
+ outside the repo) rather than shipped with the package.
65
+ - **`psyphy.viz`** : `plot_ellipses`, plus `auto_scale` and `ellipse_segments`. The
66
+ geometry is separated from the drawing layer so it is testable without a plotting
67
+ backend, and `matplotlib` is imported lazily.
68
+ - **Threshold prediction as first-class API** , `WPPMPredictivePosterior(...,
69
+ threshold_pred=True)` with a `ThresholdConfig`, recovering threshold contours by
70
+ numerically inverting `P(correct)`. In this mode `X` is bare reference points of shape
71
+ `(n_test, input_dim)` rather than paired stimuli.
72
+ - **1-D WPPM support** `input_dim=1` is now handled by the Chebyshev basis, the
73
+ prior, and the covariance-field computation, alongside the existing 2-D and 3-D cases.
74
+ - **A distributional layer in the likelihood hierarchy**
75
+ `BernoulliTaskLikelihood` and `GaussianTaskLikelihood` sit between `TaskLikelihood` and
76
+ concrete tasks, each providing `loglik` and `simulate` so a new task only implements
77
+ `predict`. `OddityTask` is now a `BernoulliTaskLikelihood`.
78
+ - **`reduction` on `MAPOptimizer`** `"mean"` (new default) or `"sum"`, controlling how
79
+ the per-trial objective is aggregated. This interacts with gradient clipping: under
80
+ `"sum"` the gradient scales with the number of trials, so a learning rate tuned on one
81
+ dataset size does not transfer. `"mean"` makes learning rates comparable to those
82
+ reported by Hong et al 2025.
83
+ - **Tutorials** reproduction of Hong et al. (2025) Figure 2B (threshold contours) from the published data,
84
+ recovery of Weber's law with a flexible WPPM, and ellipse-field plotting.
85
+ - **Tests**: `test_data_published_hong2025.py`, `test_viz.py`, `test_docs_recipe.py`
86
+ (parses the code quoted in the docs and checks every call against the live API),
87
+ `test_quick_start_recovery.py`, `test_map_optimizer_clipping.py`,
88
+ `test_likelihood_logic.py`, `test_data_format.py`.
89
+
90
+ ### Fixed
91
+
92
+ - **Response-shape broadcasting in the Bernoulli log-likelihood** (#140). With
93
+ `responses` of shape `(N, 1)` and probabilities of shape `(N,)`, `jnp.where` broadcast
94
+ to `(N, N)`, so the summed objective mixed every trial's response with every trial's
95
+ probability and the gradient was wrong. Responses are now reduced to `(N,)` first.
96
+ - **Deprecated `jax.tree_map` replaced** with `jax.tree.map` (#71 — thanks
97
+ @rohansood10).
98
+
99
+ ### Changed
100
+
101
+ - `requires-python` is `>=3.10`; CI runs lint, type checks, and tests on 3.10, 3.11, and
102
+ 3.12.
103
+ - Documentation pages now quote code from the runnable scripts beside them via snippet
104
+ includes, so a page and its script cannot drift apart.
105
+
106
+ ## [0.0.4] — 2026-03-31
107
+
108
+ Likelihood refactor. `loglik` and `simulate` became concrete methods on
109
+ `TaskLikelihood`, so a concrete task implements only `predict`; `OddityTask` lost its own
110
+ `loglik` and the duplicated vectorised Monte Carlo path (`likelihood.py` net −200 lines).
111
+ Documentation restructuring.
112
+
113
+ ## [0.0.2] — 2026-03-27
114
+
115
+ First release published to PyPI. Full initial module set: `psyphy.model` (WPPM, priors,
116
+ noise models, the oddity task), `psyphy.inference` (MAP optimizer), `psyphy.posterior`,
117
+ `psyphy.data`, `psyphy.utils`.
118
+
119
+ [0.0.5]: https://github.com/flatironinstitute/psyphy/compare/v0.0.4...v0.0.5
120
+ [0.0.4]: https://github.com/flatironinstitute/psyphy/compare/v0.0.2...v0.0.4
121
+ [0.0.2]: https://github.com/flatironinstitute/psyphy/releases/tag/v0.0.2
@@ -1,10 +1,11 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: psyphy
3
- Version: 0.0.4
3
+ Version: 0.0.5
4
4
  Summary: Adaptive Trial Placement for Psychophysical Experiments
5
5
  Project-URL: Homepage, https://flatironinstitute.github.io/psyphy
6
6
  Project-URL: Repository, https://github.com/flatironinstitute/psyphy
7
7
  Project-URL: Issues, https://github.com/flatironinstitute/psyphy/issues
8
+ Project-URL: Changelog, https://flatironinstitute.github.io/psyphy/changelog/
8
9
  Author: Hanna Dettki, Alex Williams
9
10
  Maintainer: Hanna Dettki
10
11
  License: MIT License
@@ -37,15 +38,24 @@ Requires-Dist: jax>=0.4.28
37
38
  Requires-Dist: numpy>=1.22
38
39
  Requires-Dist: optax>=0.2.4
39
40
  Requires-Dist: scipy>=1.7
41
+ Provides-Extra: cuda
42
+ Requires-Dist: jax[cuda12]>=0.4.28; extra == 'cuda'
40
43
  Provides-Extra: dev
41
44
  Requires-Dist: mypy>=1.0; extra == 'dev'
42
45
  Requires-Dist: pre-commit>=3.0; extra == 'dev'
43
46
  Requires-Dist: pytest>=8.0; extra == 'dev'
44
47
  Requires-Dist: ruff>=0.9; extra == 'dev'
45
48
  Provides-Extra: docs
46
- Requires-Dist: jupyterlab>=4.0; extra == 'docs'
47
- Requires-Dist: matplotlib>=3.5; extra == 'docs'
48
- Requires-Dist: seaborn>=0.13; extra == 'docs'
49
+ Requires-Dist: mkdocs-material>=9.7; extra == 'docs'
50
+ Requires-Dist: mkdocs<2,>=1.6; extra == 'docs'
51
+ Requires-Dist: mkdocstrings[python]>=1.0; extra == 'docs'
52
+ Requires-Dist: pymdown-extensions>=11.0; extra == 'docs'
53
+ Provides-Extra: examples
54
+ Requires-Dist: jupyterlab>=4.0; extra == 'examples'
55
+ Requires-Dist: matplotlib>=3.5; extra == 'examples'
56
+ Requires-Dist: seaborn>=0.13; extra == 'examples'
57
+ Provides-Extra: viz
58
+ Requires-Dist: matplotlib>=3.5; extra == 'viz'
49
59
  Description-Content-Type: text/markdown
50
60
 
51
61
 
@@ -88,6 +98,17 @@ cd psyphy
88
98
  pip install -e .
89
99
 
90
100
  ```
101
+ Contributors can also use [uv](https://docs.astral.sh/uv/), which installs from the committed `uv.lock` for a reproducible environment instead of resolving the loose ranges above fresh each time; see [CONTRIBUTING.md](CONTRIBUTING.md) for the uv-based workflow.
102
+
103
+ ### GPU support
104
+ The commands above install a **CPU-only** `jax`. For an NVIDIA/CUDA GPU (including the Flatiron cluster), install the `cuda` extra instead:
105
+ ```bash
106
+ pip install "psyphy[cuda]" # from PyPI
107
+ pip install -e ".[cuda]" # from a clone
108
+ ```
109
+ This pulls in JAX's own `cuda12` extra, which bundles a matching CUDA/cuDNN runtime as pip packages — no system CUDA module needs to be loaded alongside it.
110
+
111
+ **Apple Silicon (M-series) GPUs are not supported.** JAX's Metal backend cannot do `float64`, which some `psyphy` examples require for published-precision comparisons (Apple/Google's own `jax-metal` package is also no longer maintained). On a Mac, `psyphy` runs on CPU.
91
112
 
92
113
  ## [Quickstart](https://flatironinstitute.github.io/psyphy/examples/wppm/quick_start/)
93
114
  - Go [here](https://flatironinstitute.github.io/psyphy/examples/wppm/quick_start/) for a light-weight tutorial that demonstrates how to instantiate, evaluate and fit a model quickly. You should be able to run the underlying [script](https://github.com/flatironinstitute/psyphy/blob/main/docs/examples/wppm/quick_start.py) on your CPU.
@@ -38,6 +38,17 @@ cd psyphy
38
38
  pip install -e .
39
39
 
40
40
  ```
41
+ Contributors can also use [uv](https://docs.astral.sh/uv/), which installs from the committed `uv.lock` for a reproducible environment instead of resolving the loose ranges above fresh each time; see [CONTRIBUTING.md](CONTRIBUTING.md) for the uv-based workflow.
42
+
43
+ ### GPU support
44
+ The commands above install a **CPU-only** `jax`. For an NVIDIA/CUDA GPU (including the Flatiron cluster), install the `cuda` extra instead:
45
+ ```bash
46
+ pip install "psyphy[cuda]" # from PyPI
47
+ pip install -e ".[cuda]" # from a clone
48
+ ```
49
+ This pulls in JAX's own `cuda12` extra, which bundles a matching CUDA/cuDNN runtime as pip packages — no system CUDA module needs to be loaded alongside it.
50
+
51
+ **Apple Silicon (M-series) GPUs are not supported.** JAX's Metal backend cannot do `float64`, which some `psyphy` examples require for published-precision comparisons (Apple/Google's own `jax-metal` package is also no longer maintained). On a Mac, `psyphy` runs on CPU.
41
52
 
42
53
  ## [Quickstart](https://flatironinstitute.github.io/psyphy/examples/wppm/quick_start/)
43
54
  - Go [here](https://flatironinstitute.github.io/psyphy/examples/wppm/quick_start/) for a light-weight tutorial that demonstrates how to instantiate, evaluate and fit a model quickly. You should be able to run the underlying [script](https://github.com/flatironinstitute/psyphy/blob/main/docs/examples/wppm/quick_start.py) on your CPU.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "psyphy"
7
- version = "0.0.4"
7
+ version = "0.0.5"
8
8
 
9
9
  authors = [
10
10
  { name = "Hanna Dettki" },
@@ -39,28 +39,69 @@ dev = [
39
39
  "mypy>=1.0",
40
40
  "pre-commit>=3.0",
41
41
  ]
42
+ # Toolchain for `mkdocs build --strict`. Kept separate from `examples` so CI's
43
+ # docs job does not have to install JupyterLab on every push to main.
44
+ #
45
+ # The `<2` bound is deliberate: MkDocs 2.0 removes the plugin system outright
46
+ # (mkdocs-material warns about this at build time, and states there is no
47
+ # migration path). This site depends on the `search` and `mkdocstrings`
48
+ # plugins, so it cannot build under 2.x. Revisit when the ecosystem settles.
42
49
  docs = [
50
+ "mkdocs>=1.6,<2",
51
+ "mkdocs-material>=9.7",
52
+ "mkdocstrings[python]>=1.0",
53
+ "pymdown-extensions>=11.0",
54
+ ]
55
+ # Plotting backend for psyphy.viz. Kept separate from `examples` so a user who
56
+ # only wants to draw covariance ellipses does not also install JupyterLab.
57
+ viz = [
58
+ "matplotlib>=3.5",
59
+ ]
60
+ # Needed only to *run* the example scripts under docs/examples/ and regenerate
61
+ # their figures. The committed plots mean the site builds without these.
62
+ examples = [
43
63
  "matplotlib>=3.5",
44
64
  "seaborn>=0.13",
45
65
  "jupyterlab>=4.0",
46
66
  ]
67
+ # GPU (NVIDIA/CUDA) support, e.g. for running the example scripts on the
68
+ # Flatiron cluster. `jax[cuda12]` pulls in jaxlib's CUDA plugin plus matching
69
+ # nvidia-*-cu12 wheels; JAX bundles its own CUDA/cuDNN runtime this way, so no
70
+ # system CUDA/cuDNN module should be loaded alongside it -- doing so puts an
71
+ # older system libcusparse/libcudnn ahead of the bundled ones on
72
+ # LD_LIBRARY_PATH and breaks GPU detection (`module load python` is enough).
73
+ #
74
+ # There is no equivalent extra for Apple Silicon GPUs: JAX's Metal backend
75
+ # does not support float64, which the WPPM examples require for their
76
+ # published-precision comparisons, so Mac users run CPU-only. Third-party
77
+ # Metal backends exist (jax-mps / applejax) but are not wired up here.
78
+ cuda = [
79
+ "jax[cuda12]>=0.4.28",
80
+ ]
47
81
 
48
82
  [project.urls]
49
83
  Homepage = "https://flatironinstitute.github.io/psyphy"
50
84
  Repository = "https://github.com/flatironinstitute/psyphy"
51
85
  Issues = "https://github.com/flatironinstitute/psyphy/issues"
86
+ Changelog = "https://flatironinstitute.github.io/psyphy/changelog/"
52
87
 
53
88
  [tool.hatch.build.targets.wheel]
54
89
  packages = ["src/psyphy"]
55
90
 
56
91
  [tool.hatch.build.targets.sdist]
57
- include = ["src/psyphy", "README.md", "LICENSE.md", "tests"]
92
+ include = ["src/psyphy", "README.md", "LICENSE.md", "CHANGELOG.md", "tests"]
58
93
 
59
94
  # Ruff configuration
60
95
  [tool.ruff]
61
96
  line-length = 88
62
97
  target-version = "py39"
63
98
  src = ["src", "tests"]
99
+ # Ruff >=0.16 formats Python code blocks inside Markdown. The docs pages embed
100
+ # snippets from docs/examples/*.py via pymdownx.snippets' `--8<--` includes, so
101
+ # the code is already formatted at its source; letting the formatter rewrite the
102
+ # rendered copies would only churn the prose files and desync them from CI,
103
+ # which lints src/ and tests/ only.
104
+ extend-exclude = ["*.md"]
64
105
 
65
106
  [tool.ruff.lint]
66
107
  select = [
@@ -82,7 +82,7 @@ from . import posterior as posterior
82
82
  # from . import session as session
83
83
  from . import trial_placement as trial_placement
84
84
  from . import utils as utils
85
- from .data.dataset import ResponseData, TrialBatch
85
+ from .data.dataset import ResponseData, TrialBatch, TrialData
86
86
  from .inference.langevin import LangevinSampler
87
87
  from .inference.laplace import LaplaceApproximation
88
88
 
@@ -116,6 +116,7 @@ __all__ = [
116
116
  # Data handling
117
117
  "ResponseData",
118
118
  "TrialBatch",
119
+ "TrialData",
119
120
  # Subpackages
120
121
  "model",
121
122
  "inference",
@@ -8,8 +8,10 @@ Includes:
8
8
  - dataset: ResponseData, TrialBatch, loaders
9
9
  - transforms: color/model space conversions
10
10
  - io: save/load datasets
11
+ - published: loaders for published third-party datasets (downloaded on request)
11
12
  """
12
13
 
14
+ from . import published as published
13
15
  from .dataset import ResponseData, TrialBatch, TrialData
14
16
 
15
- __all__ = ["ResponseData", "TrialBatch", "TrialData"]
17
+ __all__ = ["ResponseData", "TrialBatch", "TrialData", "published"]