From 225c395c78306f3762febec9eb3862c69157a09e Mon Sep 17 00:00:00 2001 From: Francesco Zanetta Date: Mon, 15 Jul 2024 11:39:23 +0200 Subject: [PATCH 01/16] rename static dir --- docs/{_static => static}/GP.pdf | Bin docs/{_static => static}/GP.svg | 0 docs/{_static => static}/bijector_figure.svg | 0 docs/{_static => static}/css/gpjax_theme.css | 2 +- docs/{_static => static}/favicon.ico | Bin docs/{_static => static}/gpjax.mplstyle | 0 docs/{_static => static}/gpjax_logo.pdf | Bin docs/{_static => static}/gpjax_logo.svg | 0 docs/{_static => static}/jaxkern/lato.ttf | Bin docs/{_static => static}/jaxkern/logo.png | Bin docs/{_static => static}/jaxkern/logo.svg | 0 docs/{_static => static}/jaxkern/main.py | 0 docs/{_static => static}/step_size_figure.png | Bin docs/{_static => static}/step_size_figure.svg | 0 14 files changed, 1 insertion(+), 1 deletion(-) rename docs/{_static => static}/GP.pdf (100%) rename docs/{_static => static}/GP.svg (100%) rename docs/{_static => static}/bijector_figure.svg (100%) rename docs/{_static => static}/css/gpjax_theme.css (95%) rename docs/{_static => static}/favicon.ico (100%) rename docs/{_static => static}/gpjax.mplstyle (100%) rename docs/{_static => static}/gpjax_logo.pdf (100%) rename docs/{_static => static}/gpjax_logo.svg (100%) rename docs/{_static => static}/jaxkern/lato.ttf (100%) rename docs/{_static => static}/jaxkern/logo.png (100%) rename docs/{_static => static}/jaxkern/logo.svg (100%) rename docs/{_static => static}/jaxkern/main.py (100%) rename docs/{_static => static}/step_size_figure.png (100%) rename docs/{_static => static}/step_size_figure.svg (100%) diff --git a/docs/_static/GP.pdf b/docs/static/GP.pdf similarity index 100% rename from docs/_static/GP.pdf rename to docs/static/GP.pdf diff --git a/docs/_static/GP.svg b/docs/static/GP.svg similarity index 100% rename from docs/_static/GP.svg rename to docs/static/GP.svg diff --git a/docs/_static/bijector_figure.svg b/docs/static/bijector_figure.svg similarity index 100% rename from docs/_static/bijector_figure.svg rename to docs/static/bijector_figure.svg diff --git a/docs/_static/css/gpjax_theme.css b/docs/static/css/gpjax_theme.css similarity index 95% rename from docs/_static/css/gpjax_theme.css rename to docs/static/css/gpjax_theme.css index d564f3b95..47e6a841a 100644 --- a/docs/_static/css/gpjax_theme.css +++ b/docs/static/css/gpjax_theme.css @@ -1,3 +1,3 @@ nav .bd-links a:hover{ color: #B5121B -} +} \ No newline at end of file diff --git a/docs/_static/favicon.ico b/docs/static/favicon.ico similarity index 100% rename from docs/_static/favicon.ico rename to docs/static/favicon.ico diff --git a/docs/_static/gpjax.mplstyle b/docs/static/gpjax.mplstyle similarity index 100% rename from docs/_static/gpjax.mplstyle rename to docs/static/gpjax.mplstyle diff --git a/docs/_static/gpjax_logo.pdf b/docs/static/gpjax_logo.pdf similarity index 100% rename from docs/_static/gpjax_logo.pdf rename to docs/static/gpjax_logo.pdf diff --git a/docs/_static/gpjax_logo.svg b/docs/static/gpjax_logo.svg similarity index 100% rename from docs/_static/gpjax_logo.svg rename to docs/static/gpjax_logo.svg diff --git a/docs/_static/jaxkern/lato.ttf b/docs/static/jaxkern/lato.ttf similarity index 100% rename from docs/_static/jaxkern/lato.ttf rename to docs/static/jaxkern/lato.ttf diff --git a/docs/_static/jaxkern/logo.png b/docs/static/jaxkern/logo.png similarity index 100% rename from docs/_static/jaxkern/logo.png rename to docs/static/jaxkern/logo.png diff --git a/docs/_static/jaxkern/logo.svg b/docs/static/jaxkern/logo.svg similarity index 100% rename from docs/_static/jaxkern/logo.svg rename to docs/static/jaxkern/logo.svg diff --git a/docs/_static/jaxkern/main.py b/docs/static/jaxkern/main.py similarity index 100% rename from docs/_static/jaxkern/main.py rename to docs/static/jaxkern/main.py diff --git a/docs/_static/step_size_figure.png b/docs/static/step_size_figure.png similarity index 100% rename from docs/_static/step_size_figure.png rename to docs/static/step_size_figure.png diff --git a/docs/_static/step_size_figure.svg b/docs/static/step_size_figure.svg similarity index 100% rename from docs/_static/step_size_figure.svg rename to docs/static/step_size_figure.svg From 512eefd13d2379742c16607389c6468da43214f6 Mon Sep 17 00:00:00 2001 From: Francesco Zanetta Date: Mon, 15 Jul 2024 11:42:37 +0200 Subject: [PATCH 02/16] move examples dir in top level --- {docs/examples => examples}/barycentres.py | 8 +++++--- .../barycentres/barycentre_gp.gif | Bin .../bayesian_optimisation.py | 0 {docs/examples => examples}/classification.py | 0 {docs/examples => examples}/collapsed_vi.py | 0 .../constructing_new_kernels.py | 0 .../data/max_tempeature_switzerland.csv | 0 .../data/yacht_hydrodynamics.data | 0 {docs/examples => examples}/decision_making.py | 0 {docs/examples => examples}/deep_kernels.py | 0 {docs/examples => examples}/gpjax.mplstyle | 3 --- {docs/examples => examples}/graph_kernels.py | 0 {docs/examples => examples}/intro_to_gps.py | 0 .../intro_to_gps/decomposed_mll.png | Bin .../intro_to_gps/generating_process.png | Bin {docs/examples => examples}/intro_to_kernels.py | 0 {docs/examples => examples}/likelihoods_guide.py | 10 ++++------ {docs/examples => examples}/oceanmodelling.py | 0 {docs/examples => examples}/poisson.py | 0 {docs/examples => examples}/regression.py | 14 +++++++++----- {docs/examples => examples}/uncollapsed_vi.py | 0 {docs/examples => examples}/utils.py | 8 ++++++++ {docs/examples => examples}/yacht.py | 0 23 files changed, 26 insertions(+), 17 deletions(-) rename {docs/examples => examples}/barycentres.py (98%) rename {docs/examples => examples}/barycentres/barycentre_gp.gif (100%) rename {docs/examples => examples}/bayesian_optimisation.py (100%) rename {docs/examples => examples}/classification.py (100%) rename {docs/examples => examples}/collapsed_vi.py (100%) rename {docs/examples => examples}/constructing_new_kernels.py (100%) rename {docs/examples => examples}/data/max_tempeature_switzerland.csv (100%) rename {docs/examples => examples}/data/yacht_hydrodynamics.data (100%) rename {docs/examples => examples}/decision_making.py (100%) rename {docs/examples => examples}/deep_kernels.py (100%) rename {docs/examples => examples}/gpjax.mplstyle (93%) rename {docs/examples => examples}/graph_kernels.py (100%) rename {docs/examples => examples}/intro_to_gps.py (100%) rename {docs/examples => examples}/intro_to_gps/decomposed_mll.png (100%) rename {docs/examples => examples}/intro_to_gps/generating_process.png (100%) rename {docs/examples => examples}/intro_to_kernels.py (100%) rename {docs/examples => examples}/likelihoods_guide.py (97%) rename {docs/examples => examples}/oceanmodelling.py (100%) rename {docs/examples => examples}/poisson.py (100%) rename {docs/examples => examples}/regression.py (97%) rename {docs/examples => examples}/uncollapsed_vi.py (100%) rename {docs/examples => examples}/utils.py (92%) rename {docs/examples => examples}/yacht.py (100%) diff --git a/docs/examples/barycentres.py b/examples/barycentres.py similarity index 98% rename from docs/examples/barycentres.py rename to examples/barycentres.py index 49836743b..a850a1b6a 100644 --- a/docs/examples/barycentres.py +++ b/examples/barycentres.py @@ -44,15 +44,17 @@ from jaxtyping import install_import_hook import matplotlib.pyplot as plt import tensorflow_probability.substrates.jax.distributions as tfd +from examples.utils import mpl_use_gpjaxstyle with install_import_hook("gpjax", "beartype.beartype"): import gpjax as gpx key = jr.key(123) -plt.style.use( - "https://raw.githubusercontent.com/JaxGaussianProcesses/GPJax/main/docs/examples/gpjax.mplstyle" -) + +# set the default style for plotting +mpl_use_gpjaxstyle() + cols = plt.rcParams["axes.prop_cycle"].by_key()["color"] # %% [markdown] diff --git a/docs/examples/barycentres/barycentre_gp.gif b/examples/barycentres/barycentre_gp.gif similarity index 100% rename from docs/examples/barycentres/barycentre_gp.gif rename to examples/barycentres/barycentre_gp.gif diff --git a/docs/examples/bayesian_optimisation.py b/examples/bayesian_optimisation.py similarity index 100% rename from docs/examples/bayesian_optimisation.py rename to examples/bayesian_optimisation.py diff --git a/docs/examples/classification.py b/examples/classification.py similarity index 100% rename from docs/examples/classification.py rename to examples/classification.py diff --git a/docs/examples/collapsed_vi.py b/examples/collapsed_vi.py similarity index 100% rename from docs/examples/collapsed_vi.py rename to examples/collapsed_vi.py diff --git a/docs/examples/constructing_new_kernels.py b/examples/constructing_new_kernels.py similarity index 100% rename from docs/examples/constructing_new_kernels.py rename to examples/constructing_new_kernels.py diff --git a/docs/examples/data/max_tempeature_switzerland.csv b/examples/data/max_tempeature_switzerland.csv similarity index 100% rename from docs/examples/data/max_tempeature_switzerland.csv rename to examples/data/max_tempeature_switzerland.csv diff --git a/docs/examples/data/yacht_hydrodynamics.data b/examples/data/yacht_hydrodynamics.data similarity index 100% rename from docs/examples/data/yacht_hydrodynamics.data rename to examples/data/yacht_hydrodynamics.data diff --git a/docs/examples/decision_making.py b/examples/decision_making.py similarity index 100% rename from docs/examples/decision_making.py rename to examples/decision_making.py diff --git a/docs/examples/deep_kernels.py b/examples/deep_kernels.py similarity index 100% rename from docs/examples/deep_kernels.py rename to examples/deep_kernels.py diff --git a/docs/examples/gpjax.mplstyle b/examples/gpjax.mplstyle similarity index 93% rename from docs/examples/gpjax.mplstyle rename to examples/gpjax.mplstyle index 38fe42c10..e62ef6ced 100644 --- a/docs/examples/gpjax.mplstyle +++ b/examples/gpjax.mplstyle @@ -14,10 +14,7 @@ axes.axisbelow: true ### Fonts mathtext.fontset: cm -font.family: serif -font.serif: Computer Modern Roman font.size: 10 -text.usetex: True # Axes ticks ytick.left: True diff --git a/docs/examples/graph_kernels.py b/examples/graph_kernels.py similarity index 100% rename from docs/examples/graph_kernels.py rename to examples/graph_kernels.py diff --git a/docs/examples/intro_to_gps.py b/examples/intro_to_gps.py similarity index 100% rename from docs/examples/intro_to_gps.py rename to examples/intro_to_gps.py diff --git a/docs/examples/intro_to_gps/decomposed_mll.png b/examples/intro_to_gps/decomposed_mll.png similarity index 100% rename from docs/examples/intro_to_gps/decomposed_mll.png rename to examples/intro_to_gps/decomposed_mll.png diff --git a/docs/examples/intro_to_gps/generating_process.png b/examples/intro_to_gps/generating_process.png similarity index 100% rename from docs/examples/intro_to_gps/generating_process.png rename to examples/intro_to_gps/generating_process.png diff --git a/docs/examples/intro_to_kernels.py b/examples/intro_to_kernels.py similarity index 100% rename from docs/examples/intro_to_kernels.py rename to examples/intro_to_kernels.py diff --git a/docs/examples/likelihoods_guide.py b/examples/likelihoods_guide.py similarity index 97% rename from docs/examples/likelihoods_guide.py rename to examples/likelihoods_guide.py index 8b3675ffd..2bff2fdfe 100644 --- a/docs/examples/likelihoods_guide.py +++ b/examples/likelihoods_guide.py @@ -25,12 +25,12 @@ # In this section we'll provide a short introduction to likelihoods and why they are # important. For users who are already familiar with likelihoods, feel free to skip to # the next section, and for users who would like more information than is provided -# here, please see our [introduction to Gaussian processes notebook](intro_to_gps.py). +# here, please see our [introduction to Gaussian processes notebook](intro_to_gps.md). # # ### What is a likelihood? # # We adopt the notation of our -# [introduction to Gaussian processes notebook](intro_to_gps.py) where we have a +# [introduction to Gaussian processes notebook](intro_to_gps.md) where we have a # Gaussian process (GP) $f(\cdot)\sim\mathcal{GP}(m(\cdot), k(\cdot, \cdot))$ and a # dataset $\mathbf{y} = \{y_n\}_{n=1}^N$ observed at corresponding inputs # $\mathbf{x} = \{x_n\}_{n=1}^N$. The evaluation of $f$ at $\mathbf{x}$ is denoted by @@ -128,9 +128,7 @@ gpx.likelihoods.Gaussian(num_datapoints=D.n, obs_stddev=0.5) # %% [markdown] -# To control other properties of the observation noise such as trainability and value -# constraints, see our [PyTree guide](pytrees.md). -# + # ### Prediction # # The `predict` method of a likelihood object transforms the latent distribution of @@ -224,7 +222,7 @@ # # The final method that is associated with a likelihood function in GPJax is the # expected log-likelihood. This term is evaluated in the -# [stochastic variational Gaussian process](uncollapsed_vi.py) in the ELBO term. For a +# [stochastic variational Gaussian process](uncollapsed_vi.md) in the ELBO term. For a # variational approximation $q(f)= \mathcal{N}(f\mid m, S)$, the ELBO can be written as # $$ # \begin{align} diff --git a/docs/examples/oceanmodelling.py b/examples/oceanmodelling.py similarity index 100% rename from docs/examples/oceanmodelling.py rename to examples/oceanmodelling.py diff --git a/docs/examples/poisson.py b/examples/poisson.py similarity index 100% rename from docs/examples/poisson.py rename to examples/poisson.py diff --git a/docs/examples/regression.py b/examples/regression.py similarity index 97% rename from docs/examples/regression.py rename to examples/regression.py index c060677c1..4a7ecd507 100644 --- a/docs/examples/regression.py +++ b/examples/regression.py @@ -30,15 +30,16 @@ from jaxtyping import install_import_hook import matplotlib as mpl import matplotlib.pyplot as plt -from docs.examples.utils import clean_legend +from examples.utils import clean_legend, mpl_use_gpjaxstyle with install_import_hook("gpjax", "beartype.beartype"): import gpjax as gpx key = jr.key(123) -plt.style.use( - "https://raw.githubusercontent.com/JaxGaussianProcesses/GPJax/main/docs/examples/gpjax.mplstyle" -) + +# set the default style for plotting +mpl_use_gpjaxstyle() + cols = mpl.rcParams["axes.prop_cycle"].by_key()["color"] # %% [markdown] @@ -55,7 +56,7 @@ # %% n = 100 -noise = 0.3 +noise = 0.3 key, subkey = jr.split(key) x = jr.uniform(key=key, minval=-3.0, maxval=3.0, shape=(n,)).reshape(-1, 1) @@ -97,6 +98,7 @@ # smoothness of the outputs that our GP can generate. # # For simplicity, we consider a radial basis function (RBF) kernel: +# # $$k(x, x') = \sigma^2 \exp\left(-\frac{\lVert x - x' \rVert_2^2}{2 \ell^2}\right).$$ # # On paper a GP is written as $f(\cdot) \sim \mathcal{GP}(\textbf{0}, k(\cdot, \cdot'))$, @@ -146,7 +148,9 @@ # notion of a likelihood function $p(\mathcal{D} | f(\cdot))$. While the choice of # likelihood is a critical in Bayesian modelling, for simplicity we consider a # Gaussian with noise parameter $\alpha$ +# # $$p(\mathcal{D} | f(\cdot)) = \mathcal{N}(\boldsymbol{y}; f(\boldsymbol{x}), \textbf{I} \alpha^2).$$ +# # This is defined in GPJax through calling a `Gaussian` instance. # %% diff --git a/docs/examples/uncollapsed_vi.py b/examples/uncollapsed_vi.py similarity index 100% rename from docs/examples/uncollapsed_vi.py rename to examples/uncollapsed_vi.py diff --git a/docs/examples/utils.py b/examples/utils.py similarity index 92% rename from docs/examples/utils.py rename to examples/utils.py index 520e86a5a..539a7bcfa 100644 --- a/docs/examples/utils.py +++ b/examples/utils.py @@ -1,3 +1,6 @@ +from pathlib import Path + +import matplotlib.pyplot as plt from matplotlib import transforms from matplotlib.patches import Ellipse import numpy as np @@ -70,3 +73,8 @@ def clean_legend(ax): by_label = dict(zip(labels, handles)) ax.legend(by_label.values(), by_label.keys()) return ax + + +def mpl_use_gpjaxstyle(): + + plt.style.use(Path(__file__).parent / "gpjax.mplstyle") \ No newline at end of file diff --git a/docs/examples/yacht.py b/examples/yacht.py similarity index 100% rename from docs/examples/yacht.py rename to examples/yacht.py From 36791a0809930c925817542216b10eaf43ff9599 Mon Sep 17 00:00:00 2001 From: Francesco Zanetta Date: Mon, 15 Jul 2024 11:43:23 +0200 Subject: [PATCH 03/16] add _examples generated dir to gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ae49fa031..e51d8509c 100644 --- a/.gitignore +++ b/.gitignore @@ -152,4 +152,4 @@ package-lock.json node_modules/ docs/api -docs/examples/*.md +docs/_examples From 0883abfd69ee0925b74d79ffc875756c65b9cfd4 Mon Sep 17 00:00:00 2001 From: Francesco Zanetta Date: Mon, 15 Jul 2024 11:43:42 +0200 Subject: [PATCH 04/16] update pyproject deps --- poetry.lock | 166 +++++++++++++++++++++++++------------------------ pyproject.toml | 2 +- 2 files changed, 85 insertions(+), 83 deletions(-) diff --git a/poetry.lock b/poetry.lock index 5c1e3f508..de2f16bde 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "absl-py" @@ -653,63 +653,63 @@ test-no-images = ["pytest", "pytest-cov", "pytest-xdist", "wurlitzer"] [[package]] name = "coverage" -version = "7.5.4" +version = "7.6.0" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.8" files = [ - {file = "coverage-7.5.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6cfb5a4f556bb51aba274588200a46e4dd6b505fb1a5f8c5ae408222eb416f99"}, - {file = "coverage-7.5.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2174e7c23e0a454ffe12267a10732c273243b4f2d50d07544a91198f05c48f47"}, - {file = "coverage-7.5.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2214ee920787d85db1b6a0bd9da5f8503ccc8fcd5814d90796c2f2493a2f4d2e"}, - {file = "coverage-7.5.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1137f46adb28e3813dec8c01fefadcb8c614f33576f672962e323b5128d9a68d"}, - {file = "coverage-7.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b385d49609f8e9efc885790a5a0e89f2e3ae042cdf12958b6034cc442de428d3"}, - {file = "coverage-7.5.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b4a474f799456e0eb46d78ab07303286a84a3140e9700b9e154cfebc8f527016"}, - {file = "coverage-7.5.4-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:5cd64adedf3be66f8ccee418473c2916492d53cbafbfcff851cbec5a8454b136"}, - {file = "coverage-7.5.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e564c2cf45d2f44a9da56f4e3a26b2236504a496eb4cb0ca7221cd4cc7a9aca9"}, - {file = "coverage-7.5.4-cp310-cp310-win32.whl", hash = "sha256:7076b4b3a5f6d2b5d7f1185fde25b1e54eb66e647a1dfef0e2c2bfaf9b4c88c8"}, - {file = "coverage-7.5.4-cp310-cp310-win_amd64.whl", hash = "sha256:018a12985185038a5b2bcafab04ab833a9a0f2c59995b3cec07e10074c78635f"}, - {file = "coverage-7.5.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:db14f552ac38f10758ad14dd7b983dbab424e731588d300c7db25b6f89e335b5"}, - {file = "coverage-7.5.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3257fdd8e574805f27bb5342b77bc65578e98cbc004a92232106344053f319ba"}, - {file = "coverage-7.5.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a6612c99081d8d6134005b1354191e103ec9705d7ba2754e848211ac8cacc6b"}, - {file = "coverage-7.5.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d45d3cbd94159c468b9b8c5a556e3f6b81a8d1af2a92b77320e887c3e7a5d080"}, - {file = "coverage-7.5.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ed550e7442f278af76d9d65af48069f1fb84c9f745ae249c1a183c1e9d1b025c"}, - {file = "coverage-7.5.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7a892be37ca35eb5019ec85402c3371b0f7cda5ab5056023a7f13da0961e60da"}, - {file = "coverage-7.5.4-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8192794d120167e2a64721d88dbd688584675e86e15d0569599257566dec9bf0"}, - {file = "coverage-7.5.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:820bc841faa502e727a48311948e0461132a9c8baa42f6b2b84a29ced24cc078"}, - {file = "coverage-7.5.4-cp311-cp311-win32.whl", hash = "sha256:6aae5cce399a0f065da65c7bb1e8abd5c7a3043da9dceb429ebe1b289bc07806"}, - {file = "coverage-7.5.4-cp311-cp311-win_amd64.whl", hash = "sha256:d2e344d6adc8ef81c5a233d3a57b3c7d5181f40e79e05e1c143da143ccb6377d"}, - {file = "coverage-7.5.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:54317c2b806354cbb2dc7ac27e2b93f97096912cc16b18289c5d4e44fc663233"}, - {file = "coverage-7.5.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:042183de01f8b6d531e10c197f7f0315a61e8d805ab29c5f7b51a01d62782747"}, - {file = "coverage-7.5.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a6bb74ed465d5fb204b2ec41d79bcd28afccf817de721e8a807d5141c3426638"}, - {file = "coverage-7.5.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3d45ff86efb129c599a3b287ae2e44c1e281ae0f9a9bad0edc202179bcc3a2e"}, - {file = "coverage-7.5.4-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5013ed890dc917cef2c9f765c4c6a8ae9df983cd60dbb635df8ed9f4ebc9f555"}, - {file = "coverage-7.5.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1014fbf665fef86cdfd6cb5b7371496ce35e4d2a00cda501cf9f5b9e6fced69f"}, - {file = "coverage-7.5.4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:3684bc2ff328f935981847082ba4fdc950d58906a40eafa93510d1b54c08a66c"}, - {file = "coverage-7.5.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:581ea96f92bf71a5ec0974001f900db495488434a6928a2ca7f01eee20c23805"}, - {file = "coverage-7.5.4-cp312-cp312-win32.whl", hash = "sha256:73ca8fbc5bc622e54627314c1a6f1dfdd8db69788f3443e752c215f29fa87a0b"}, - {file = "coverage-7.5.4-cp312-cp312-win_amd64.whl", hash = "sha256:cef4649ec906ea7ea5e9e796e68b987f83fa9a718514fe147f538cfeda76d7a7"}, - {file = "coverage-7.5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cdd31315fc20868c194130de9ee6bfd99755cc9565edff98ecc12585b90be882"}, - {file = "coverage-7.5.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:02ff6e898197cc1e9fa375581382b72498eb2e6d5fc0b53f03e496cfee3fac6d"}, - {file = "coverage-7.5.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d05c16cf4b4c2fc880cb12ba4c9b526e9e5d5bb1d81313d4d732a5b9fe2b9d53"}, - {file = "coverage-7.5.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c5986ee7ea0795a4095ac4d113cbb3448601efca7f158ec7f7087a6c705304e4"}, - {file = "coverage-7.5.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5df54843b88901fdc2f598ac06737f03d71168fd1175728054c8f5a2739ac3e4"}, - {file = "coverage-7.5.4-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:ab73b35e8d109bffbda9a3e91c64e29fe26e03e49addf5b43d85fc426dde11f9"}, - {file = "coverage-7.5.4-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:aea072a941b033813f5e4814541fc265a5c12ed9720daef11ca516aeacd3bd7f"}, - {file = "coverage-7.5.4-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:16852febd96acd953b0d55fc842ce2dac1710f26729b31c80b940b9afcd9896f"}, - {file = "coverage-7.5.4-cp38-cp38-win32.whl", hash = "sha256:8f894208794b164e6bd4bba61fc98bf6b06be4d390cf2daacfa6eca0a6d2bb4f"}, - {file = "coverage-7.5.4-cp38-cp38-win_amd64.whl", hash = "sha256:e2afe743289273209c992075a5a4913e8d007d569a406ffed0bd080ea02b0633"}, - {file = "coverage-7.5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b95c3a8cb0463ba9f77383d0fa8c9194cf91f64445a63fc26fb2327e1e1eb088"}, - {file = "coverage-7.5.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3d7564cc09dd91b5a6001754a5b3c6ecc4aba6323baf33a12bd751036c998be4"}, - {file = "coverage-7.5.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:44da56a2589b684813f86d07597fdf8a9c6ce77f58976727329272f5a01f99f7"}, - {file = "coverage-7.5.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e16f3d6b491c48c5ae726308e6ab1e18ee830b4cdd6913f2d7f77354b33f91c8"}, - {file = "coverage-7.5.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dbc5958cb471e5a5af41b0ddaea96a37e74ed289535e8deca404811f6cb0bc3d"}, - {file = "coverage-7.5.4-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:a04e990a2a41740b02d6182b498ee9796cf60eefe40cf859b016650147908029"}, - {file = "coverage-7.5.4-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:ddbd2f9713a79e8e7242d7c51f1929611e991d855f414ca9996c20e44a895f7c"}, - {file = "coverage-7.5.4-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:b1ccf5e728ccf83acd313c89f07c22d70d6c375a9c6f339233dcf792094bcbf7"}, - {file = "coverage-7.5.4-cp39-cp39-win32.whl", hash = "sha256:56b4eafa21c6c175b3ede004ca12c653a88b6f922494b023aeb1e836df953ace"}, - {file = "coverage-7.5.4-cp39-cp39-win_amd64.whl", hash = "sha256:65e528e2e921ba8fd67d9055e6b9f9e34b21ebd6768ae1c1723f4ea6ace1234d"}, - {file = "coverage-7.5.4-pp38.pp39.pp310-none-any.whl", hash = "sha256:79b356f3dd5b26f3ad23b35c75dbdaf1f9e2450b6bcefc6d0825ea0aa3f86ca5"}, - {file = "coverage-7.5.4.tar.gz", hash = "sha256:a44963520b069e12789d0faea4e9fdb1e410cdc4aab89d94f7f55cbb7fef0353"}, + {file = "coverage-7.6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dff044f661f59dace805eedb4a7404c573b6ff0cdba4a524141bc63d7be5c7fd"}, + {file = "coverage-7.6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a8659fd33ee9e6ca03950cfdcdf271d645cf681609153f218826dd9805ab585c"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7792f0ab20df8071d669d929c75c97fecfa6bcab82c10ee4adb91c7a54055463"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d4b3cd1ca7cd73d229487fa5caca9e4bc1f0bca96526b922d61053ea751fe791"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e7e128f85c0b419907d1f38e616c4f1e9f1d1b37a7949f44df9a73d5da5cd53c"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a94925102c89247530ae1dab7dc02c690942566f22e189cbd53579b0693c0783"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:dcd070b5b585b50e6617e8972f3fbbee786afca71b1936ac06257f7e178f00f6"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:d50a252b23b9b4dfeefc1f663c568a221092cbaded20a05a11665d0dbec9b8fb"}, + {file = "coverage-7.6.0-cp310-cp310-win32.whl", hash = "sha256:0e7b27d04131c46e6894f23a4ae186a6a2207209a05df5b6ad4caee6d54a222c"}, + {file = "coverage-7.6.0-cp310-cp310-win_amd64.whl", hash = "sha256:54dece71673b3187c86226c3ca793c5f891f9fc3d8aa183f2e3653da18566169"}, + {file = "coverage-7.6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c7b525ab52ce18c57ae232ba6f7010297a87ced82a2383b1afd238849c1ff933"}, + {file = "coverage-7.6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4bea27c4269234e06f621f3fac3925f56ff34bc14521484b8f66a580aacc2e7d"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed8d1d1821ba5fc88d4a4f45387b65de52382fa3ef1f0115a4f7a20cdfab0e94"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01c322ef2bbe15057bc4bf132b525b7e3f7206f071799eb8aa6ad1940bcf5fb1"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03cafe82c1b32b770a29fd6de923625ccac3185a54a5e66606da26d105f37dac"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0d1b923fc4a40c5832be4f35a5dab0e5ff89cddf83bb4174499e02ea089daf57"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4b03741e70fb811d1a9a1d75355cf391f274ed85847f4b78e35459899f57af4d"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a73d18625f6a8a1cbb11eadc1d03929f9510f4131879288e3f7922097a429f63"}, + {file = "coverage-7.6.0-cp311-cp311-win32.whl", hash = "sha256:65fa405b837060db569a61ec368b74688f429b32fa47a8929a7a2f9b47183713"}, + {file = "coverage-7.6.0-cp311-cp311-win_amd64.whl", hash = "sha256:6379688fb4cfa921ae349c76eb1a9ab26b65f32b03d46bb0eed841fd4cb6afb1"}, + {file = "coverage-7.6.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f7db0b6ae1f96ae41afe626095149ecd1b212b424626175a6633c2999eaad45b"}, + {file = "coverage-7.6.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bbdf9a72403110a3bdae77948b8011f644571311c2fb35ee15f0f10a8fc082e8"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc44bf0315268e253bf563f3560e6c004efe38f76db03a1558274a6e04bf5d5"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:da8549d17489cd52f85a9829d0e1d91059359b3c54a26f28bec2c5d369524807"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0086cd4fc71b7d485ac93ca4239c8f75732c2ae3ba83f6be1c9be59d9e2c6382"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1fad32ee9b27350687035cb5fdf9145bc9cf0a094a9577d43e909948ebcfa27b"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:044a0985a4f25b335882b0966625270a8d9db3d3409ddc49a4eb00b0ef5e8cee"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:76d5f82213aa78098b9b964ea89de4617e70e0d43e97900c2778a50856dac605"}, + {file = "coverage-7.6.0-cp312-cp312-win32.whl", hash = "sha256:3c59105f8d58ce500f348c5b56163a4113a440dad6daa2294b5052a10db866da"}, + {file = "coverage-7.6.0-cp312-cp312-win_amd64.whl", hash = "sha256:ca5d79cfdae420a1d52bf177de4bc2289c321d6c961ae321503b2ca59c17ae67"}, + {file = "coverage-7.6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d39bd10f0ae453554798b125d2f39884290c480f56e8a02ba7a6ed552005243b"}, + {file = "coverage-7.6.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:beb08e8508e53a568811016e59f3234d29c2583f6b6e28572f0954a6b4f7e03d"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b2e16f4cd2bc4d88ba30ca2d3bbf2f21f00f382cf4e1ce3b1ddc96c634bc48ca"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6616d1c9bf1e3faea78711ee42a8b972367d82ceae233ec0ac61cc7fec09fa6b"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad4567d6c334c46046d1c4c20024de2a1c3abc626817ae21ae3da600f5779b44"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:d17c6a415d68cfe1091d3296ba5749d3d8696e42c37fca5d4860c5bf7b729f03"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:9146579352d7b5f6412735d0f203bbd8d00113a680b66565e205bc605ef81bc6"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:cdab02a0a941af190df8782aafc591ef3ad08824f97850b015c8c6a8b3877b0b"}, + {file = "coverage-7.6.0-cp38-cp38-win32.whl", hash = "sha256:df423f351b162a702c053d5dddc0fc0ef9a9e27ea3f449781ace5f906b664428"}, + {file = "coverage-7.6.0-cp38-cp38-win_amd64.whl", hash = "sha256:f2501d60d7497fd55e391f423f965bbe9e650e9ffc3c627d5f0ac516026000b8"}, + {file = "coverage-7.6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7221f9ac9dad9492cecab6f676b3eaf9185141539d5c9689d13fd6b0d7de840c"}, + {file = "coverage-7.6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ddaaa91bfc4477d2871442bbf30a125e8fe6b05da8a0015507bfbf4718228ab2"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c4cbe651f3904e28f3a55d6f371203049034b4ddbce65a54527a3f189ca3b390"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:831b476d79408ab6ccfadaaf199906c833f02fdb32c9ab907b1d4aa0713cfa3b"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:46c3d091059ad0b9c59d1034de74a7f36dcfa7f6d3bde782c49deb42438f2450"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4d5fae0a22dc86259dee66f2cc6c1d3e490c4a1214d7daa2a93d07491c5c04b6"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:07ed352205574aad067482e53dd606926afebcb5590653121063fbf4e2175166"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:49c76cdfa13015c4560702574bad67f0e15ca5a2872c6a125f6327ead2b731dd"}, + {file = "coverage-7.6.0-cp39-cp39-win32.whl", hash = "sha256:482855914928c8175735a2a59c8dc5806cf7d8f032e4820d52e845d1f731dca2"}, + {file = "coverage-7.6.0-cp39-cp39-win_amd64.whl", hash = "sha256:543ef9179bc55edfd895154a51792b01c017c87af0ebaae092720152e19e42ca"}, + {file = "coverage-7.6.0-pp38.pp39.pp310-none-any.whl", hash = "sha256:6fe885135c8a479d3e37a7aae61cbd3a0fb2deccb4dda3c25f92a49189f766d6"}, + {file = "coverage-7.6.0.tar.gz", hash = "sha256:289cc803fa1dc901f84701ac10c9ee873619320f2f9aff38794db4a4a0268d51"}, ] [package.dependencies] @@ -866,7 +866,7 @@ files = [ [package.dependencies] fsspec = {version = "*", optional = true, markers = "extra == \"epath\""} importlib_resources = {version = "*", optional = true, markers = "extra == \"epath\""} -typing_extensions = {version = "*", optional = true, markers = "extra == \"epy\""} +typing_extensions = {version = "*", optional = true, markers = "extra == \"epath\" or extra == \"epy\""} zipp = {version = "*", optional = true, markers = "extra == \"epath\""} [package.extras] @@ -1112,6 +1112,7 @@ description = "Python AST that abstracts the underlying Python version" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" files = [ + {file = "gast-0.6.0-py3-none-any.whl", hash = "sha256:52b182313f7330389f72b069ba00f174cfe2a06411099547288839c6cbafbd54"}, {file = "gast-0.6.0.tar.gz", hash = "sha256:88fc5300d32c7ac6ca7b515310862f71e6fdf2c029bbec7c66c0f5dd47b6b1fb"}, ] @@ -1421,13 +1422,13 @@ scipy = ">=1.0.0" [[package]] name = "jaxtyping" -version = "0.2.31" +version = "0.2.33" description = "Type annotations and runtime checking for shape and dtype of JAX arrays, and PyTrees." optional = false python-versions = "~=3.9" files = [ - {file = "jaxtyping-0.2.31-py3-none-any.whl", hash = "sha256:04ed0e16ad4327270c8832334aa5d06176f475f3f8bdf7200bebc54afb1e3fd3"}, - {file = "jaxtyping-0.2.31.tar.gz", hash = "sha256:83c7c0bfae1d1ce25801480b5572d96c0f2b889785b4e50bdc25a07058b7bd50"}, + {file = "jaxtyping-0.2.33-py3-none-any.whl", hash = "sha256:918d6094c73f28d3196185ef55d1832cbcd2804d1d388f180060c4366a9e2107"}, + {file = "jaxtyping-0.2.33.tar.gz", hash = "sha256:9a9cfccae4fe05114b9fb27a5ea5440be4971a5a075bbd0526f6dd7d2730f83e"}, ] [package.dependencies] @@ -1581,13 +1582,13 @@ files = [ [[package]] name = "jupytext" -version = "1.16.2" +version = "1.16.3" description = "Jupyter notebooks as Markdown documents, Julia, Python or R scripts" optional = false python-versions = ">=3.8" files = [ - {file = "jupytext-1.16.2-py3-none-any.whl", hash = "sha256:197a43fef31dca612b68b311e01b8abd54441c7e637810b16b6cb8f2ab66065e"}, - {file = "jupytext-1.16.2.tar.gz", hash = "sha256:8627dd9becbbebd79cc4a4ed4727d89d78e606b4b464eab72357b3b029023a14"}, + {file = "jupytext-1.16.3-py3-none-any.whl", hash = "sha256:870e0d7a716dcb1303df6ad1cec65e3315a20daedd808a55cb3dae2d56e4ed20"}, + {file = "jupytext-1.16.3.tar.gz", hash = "sha256:1ebac990461dd9f477ff7feec9e3003fa1acc89f3c16ba01b73f79fd76f01a98"}, ] [package.dependencies] @@ -1599,11 +1600,11 @@ pyyaml = "*" tomli = {version = "*", markers = "python_version < \"3.11\""} [package.extras] -dev = ["autopep8", "black", "flake8", "gitpython", "ipykernel", "isort", "jupyter-fs (<0.4.0)", "jupyter-server (!=2.11)", "nbconvert", "pre-commit", "pytest", "pytest-cov (>=2.6.1)", "pytest-randomly", "pytest-xdist", "sphinx-gallery (<0.8)"] +dev = ["autopep8", "black", "flake8", "gitpython", "ipykernel", "isort", "jupyter-fs (>=1.0)", "jupyter-server (!=2.11)", "nbconvert", "pre-commit", "pytest", "pytest-cov (>=2.6.1)", "pytest-randomly", "pytest-xdist", "sphinx-gallery (<0.8)"] docs = ["myst-parser", "sphinx", "sphinx-copybutton", "sphinx-rtd-theme"] test = ["pytest", "pytest-randomly", "pytest-xdist"] test-cov = ["ipykernel", "jupyter-server (!=2.11)", "nbconvert", "pytest", "pytest-cov (>=2.6.1)", "pytest-randomly", "pytest-xdist"] -test-external = ["autopep8", "black", "flake8", "gitpython", "ipykernel", "isort", "jupyter-fs (<0.4.0)", "jupyter-server (!=2.11)", "nbconvert", "pre-commit", "pytest", "pytest-randomly", "pytest-xdist", "sphinx-gallery (<0.8)"] +test-external = ["autopep8", "black", "flake8", "gitpython", "ipykernel", "isort", "jupyter-fs (>=1.0)", "jupyter-server (!=2.11)", "nbconvert", "pre-commit", "pytest", "pytest-randomly", "pytest-xdist", "sphinx-gallery (<0.8)"] test-functional = ["pytest", "pytest-randomly", "pytest-xdist"] test-integration = ["ipykernel", "jupyter-server (!=2.11)", "nbconvert", "pytest", "pytest-randomly", "pytest-xdist"] test-ui = ["calysto-bash"] @@ -2128,13 +2129,13 @@ files = [ [[package]] name = "mkdocstrings" -version = "0.24.3" +version = "0.25.1" description = "Automatic documentation from sources, for MkDocs." optional = false python-versions = ">=3.8" files = [ - {file = "mkdocstrings-0.24.3-py3-none-any.whl", hash = "sha256:5c9cf2a32958cd161d5428699b79c8b0988856b0d4a8c5baf8395fc1bf4087c3"}, - {file = "mkdocstrings-0.24.3.tar.gz", hash = "sha256:f327b234eb8d2551a306735436e157d0a22d45f79963c60a8b585d5f7a94c1d2"}, + {file = "mkdocstrings-0.25.1-py3-none-any.whl", hash = "sha256:da01fcc2670ad61888e8fe5b60afe9fee5781017d67431996832d63e887c2e51"}, + {file = "mkdocstrings-0.25.1.tar.gz", hash = "sha256:c3a2515f31577f311a9ee58d089e4c51fc6046dbd9e9b4c3de4c3194667fe9bf"}, ] [package.dependencies] @@ -2155,18 +2156,18 @@ python-legacy = ["mkdocstrings-python-legacy (>=0.2.1)"] [[package]] name = "mkdocstrings-python" -version = "1.10.0" +version = "1.10.5" description = "A Python handler for mkdocstrings." optional = false python-versions = ">=3.8" files = [ - {file = "mkdocstrings_python-1.10.0-py3-none-any.whl", hash = "sha256:ba833fbd9d178a4b9d5cb2553a4df06e51dc1f51e41559a4d2398c16a6f69ecc"}, - {file = "mkdocstrings_python-1.10.0.tar.gz", hash = "sha256:71678fac657d4d2bb301eed4e4d2d91499c095fd1f8a90fa76422a87a5693828"}, + {file = "mkdocstrings_python-1.10.5-py3-none-any.whl", hash = "sha256:92e3c588ef1b41151f55281d075de7558dd8092e422cb07a65b18ee2b0863ebb"}, + {file = "mkdocstrings_python-1.10.5.tar.gz", hash = "sha256:acdc2a98cd9d46c7ece508193a16ca03ccabcb67520352b7449f84b57c162bdf"}, ] [package.dependencies] -griffe = ">=0.44" -mkdocstrings = ">=0.24.2" +griffe = ">=0.47" +mkdocstrings = ">=0.25" [[package]] name = "mktestdocs" @@ -2467,27 +2468,28 @@ tests = ["pytest", "pytest-cov", "pytest-pep8"] [[package]] name = "optax" -version = "0.2.2" +version = "0.2.3" description = "A gradient processing and optimisation library in JAX." optional = false python-versions = ">=3.9" files = [ - {file = "optax-0.2.2-py3-none-any.whl", hash = "sha256:411c414a76aae259f4191a60b712663968741a5163ca92fc250b5d5c7d36fb57"}, - {file = "optax-0.2.2.tar.gz", hash = "sha256:f09bf790ef4b09fb9c35f79a07594c6196a719919985f542dc84b0bf97812e0e"}, + {file = "optax-0.2.3-py3-none-any.whl", hash = "sha256:083e603dcd731d7e74d99f71c12f77937dd53f79001b4c09c290e4f47dd2e94f"}, + {file = "optax-0.2.3.tar.gz", hash = "sha256:ec7ab925440b0c5a512e1f24fba0fb3e7d760a7fd5d2496d7a691e9d37da01d9"}, ] [package.dependencies] absl-py = ">=0.7.1" chex = ">=0.1.86" -jax = ">=0.1.55" -jaxlib = ">=0.1.37" +etils = {version = "*", extras = ["epy"]} +jax = ">=0.4.27" +jaxlib = ">=0.4.27" numpy = ">=1.18.0" [package.extras] docs = ["flax", "ipython (>=8.8.0)", "matplotlib (>=3.5.0)", "myst-nb (>=1.0.0)", "sphinx (>=6.0.0)", "sphinx-autodoc-typehints", "sphinx-book-theme (>=1.0.1)", "sphinx-collections (>=0.0.1)", "sphinx-gallery (>=0.14.0)", "sphinx_contributors", "sphinxcontrib-katex", "tensorflow (>=2.4.0)", "tensorflow-datasets (>=4.2.0)"] dp-accounting = ["absl-py (>=1.0.0)", "attrs (>=21.4.0)", "mpmath (>=1.2.1)", "numpy (>=1.21.4)", "scipy (>=1.7.1)"] -examples = ["dp_accounting (>=0.4)", "flax", "tensorflow (>=2.4.0)", "tensorflow-datasets (>=4.2.0)"] -test = ["dm-tree (>=0.1.7)", "flax (>=0.5.3)"] +examples = ["dp_accounting (>=0.4)", "flax", "ipywidgets", "tensorflow (>=2.4.0)", "tensorflow-datasets (>=4.2.0)"] +test = ["dm-tree (>=0.1.7)", "flax (>=0.5.3)", "scikit-learn", "scipy (>=1.7.1)"] [[package]] name = "optree" @@ -3718,13 +3720,13 @@ stats = ["scipy (>=1.3)", "statsmodels (>=0.10)"] [[package]] name = "setuptools" -version = "70.2.0" +version = "70.3.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-70.2.0-py3-none-any.whl", hash = "sha256:b8b8060bb426838fbe942479c90296ce976249451118ef566a5a0b7d8b78fb05"}, - {file = "setuptools-70.2.0.tar.gz", hash = "sha256:bd63e505105011b25c3c11f753f7e3b8465ea739efddaccef8f0efac2137bac1"}, + {file = "setuptools-70.3.0-py3-none-any.whl", hash = "sha256:fe384da74336c398e0d956d1cae0669bc02eed936cdb1d49b57de1990dc11ffc"}, + {file = "setuptools-70.3.0.tar.gz", hash = "sha256:f171bab1dfbc86b132997f26a119f6056a57950d058587841a0082e8830f9dc5"}, ] [package.extras] @@ -4139,4 +4141,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.12" -content-hash = "11180d2b39dd5cdc9d98aa088303d2a59b00b64f958c33539a97e07188d5af72" +content-hash = "e66211ae5b75381517e713944e270de9f6774da7f9d139781bdc926401bba7f1" diff --git a/pyproject.toml b/pyproject.toml index bead7c5d3..42e11de4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ asv = "^0.6.0" [tool.poetry.group.docs.dependencies] mkdocs = "^1.5.3" mkdocs-material = "^9.5.12" -mkdocstrings = { version = "^0.24.1", extras = ["python"] } +mkdocstrings = { version = "^0.25.1", extras = ["python"] } mkdocs-jupyter = "^0.24.3" mkdocs-gen-files = "^0.5.0" mkdocs-literate-nav = "^0.6.0" From 165e1b8c7a42e4c8f302b8cdf9c37c975870d8f1 Mon Sep 17 00:00:00 2001 From: Francesco Zanetta Date: Mon, 15 Jul 2024 11:46:55 +0200 Subject: [PATCH 05/16] update mkdocs config --- mkdocs.yml | 53 ++++++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index f9c1a95f9..87b51b122 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -4,7 +4,7 @@ site_url: https://docs.jaxgaussianprocesses.com/ repo_url: https://github.com/JaxGaussianProcesses/GPJax repo_name: JaxGaussianProcesses/GPJax -edit_uri: "" +# edit_uri: "" nav: - 🏡 Home: index.md @@ -13,28 +13,27 @@ nav: - 🎨 Design principles: design.md - 🤝 Contributing: contributing.md - 🔪 Sharp bits: sharp_bits.md - - 🌳 GPJax PyTrees: examples/pytrees.md - 📎 JAX 101 [External]: https://jax.readthedocs.io/en/latest/jax-101/index.html - 💡 Background: - - Intro to GPs: examples/intro_to_gps.md - - Intro to Kernels: examples/intro_to_kernels.md + - Intro to GPs: _examples/intro_to_gps.md + - Intro to Kernels: _examples/intro_to_kernels.md - 🎓 Tutorials: - - Regression: examples/regression.md - - Classification: examples/classification.md - - Poisson regression: examples/poisson.md - - Barycentres: examples/barycentres.md - - Deep kernel learning: examples/deep_kernels.md - - Graph kernels: examples/graph_kernels.md - - Sparse GPs: examples/uncollapsed_vi.md - - Stochastic sparse GPs: examples/collapsed_vi.md - - Bayesian Optimisation: examples/bayesian_optimisation.md - - Decision Making: examples/decision_making.md - - Multi-output GPs for Ocean Modelling: examples/oceanmodelling.md + - Regression: _examples/regression.md + - Classification: _examples/classification.md + - Poisson regression: _examples/poisson.md + - Barycentres: _examples/barycentres.md + - Deep kernel learning: _examples/deep_kernels.md + - Graph kernels: _examples/graph_kernels.md + - Sparse GPs: _examples/uncollapsed_vi.md + - Stochastic sparse GPs: _examples/collapsed_vi.md + - Bayesian Optimisation: _examples/bayesian_optimisation.md + - Decision Making: _examples/decision_making.md + - Multi-output GPs for Ocean Modelling: _examples/oceanmodelling.md - 📖 Guides for customisation: - - Kernels: examples/constructing_new_kernels.md - - Likelihoods: examples/likelihoods_guide.md - - UCI regression: examples/yacht.md - - 💻 Raw tutorial code: give_me_the_code.md + - Kernels: _examples/constructing_new_kernels.md + - Likelihoods: _examples/likelihoods_guide.md + - UCI regression: _examples/yacht.md + # - 💻 Raw tutorial code: give_me_the_code.md - Community: - 👥 Code of conduct: CODE_OF_CONDUCT.md - 📜 Governance: GOVERNANCE.md @@ -56,16 +55,23 @@ theme: - content.code.annotate # Allow individual lines of code to be annotated icon: repo: fontawesome/brands/github - logo: _static/favicon.ico - favicon: _static/favicon.ico + logo: static/favicon.ico + favicon: static/favicon.ico markdown_extensions: + - admonition + - markdown_katex: + no_inline_svg: True + insert_fonts_css: True - pymdownx.highlight: anchor_linenums: true line_spans: __span pygments_lang_class: true + - pymdownx.tabbed: + alternate_style: true - pymdownx.inlinehilite - - pymdownx.snippets + - pymdownx.snippets: + check_paths: true - pymdownx.superfences - pymdownx.arithmatex: generic: true @@ -81,12 +87,9 @@ plugins: - gen-files: scripts: - docs/scripts/gen_pages.py - - docs/scripts/gen_examples.py - # - docs/scripts/notebook_converter.py # or any other name or path - literate-nav: nav_file: SUMMARY.md - mkdocstrings: - default_handler: python handlers: python: paths: ["gpjax"] From ad6f12a3734b5d5741a50219c1af4a6d9d2f7cf7 Mon Sep 17 00:00:00 2001 From: Francesco Zanetta Date: Mon, 15 Jul 2024 11:47:26 +0200 Subject: [PATCH 06/16] add examples generation script --- docs/scripts/gen_examples.py | 99 ++++++++++++++++++++++++++++++++---- docs/stylesheets/extra.css | 9 ++++ 2 files changed, 97 insertions(+), 11 deletions(-) diff --git a/docs/scripts/gen_examples.py b/docs/scripts/gen_examples.py index 51dd0e8cd..cc27fc31b 100644 --- a/docs/scripts/gen_examples.py +++ b/docs/scripts/gen_examples.py @@ -1,20 +1,97 @@ +""" Convert python files in "examples" directory to markdown files using jupytext and nbconvert. + +There's only a minor inconvenience with how supporting files are handled by nbconvert, +see https://github.com/jupyter/nbconvert/issues/1164. But these will be under a private +directory `_examples` in the docs folder, so it's not a big deal. + +""" +from argparse import ArgumentParser from pathlib import Path import subprocess +from concurrent.futures import ThreadPoolExecutor, as_completed +import shutil + +EXCLUDE = ["utils.py"] -EXECUTE = False -EXCLUDE = ["docs/examples/utils.py"] -ALLOW_ERRORS = False +def process_file(file: Path, out_file: Path | None = None, execute: bool = False): + """Converts a python file to markdown using jupytext and nbconvert.""" -for file in Path("docs/").glob("examples/*.py"): - if file.as_posix() in EXCLUDE: - continue + out_dir = out_file.parent + command = f"cd {out_dir.as_posix()} && " - out_file = file.with_suffix(".md") + out_file = out_file.relative_to(out_dir).as_posix() - command = "jupytext --to markdown " - command += f"{'--execute ' if EXECUTE else ''}" - command += f"{'--allow-errors ' if ALLOW_ERRORS else ''}" - command += f"{file} --output {out_file}" + if execute: + command += f"jupytext --to ipynb {file} --output - " + command += ( + f"| jupyter nbconvert --to markdown --execute --stdin --output {out_file}" + ) + else: + command = f"jupytext --to markdown {file} --output {out_file}" subprocess.run(command, shell=True, check=False) + + +def is_modified(file: Path, out_file: Path): + """Check if the output file is older than the input file.""" + return out_file.exists() and out_file.stat().st_mtime < file.stat().st_mtime + + +def main(args): + + # project root directory + wdir = Path(__file__).parents[2] + + + # output directory + out_dir: Path = args.outdir + out_dir.mkdir(exist_ok=True, parents=True) + + + # copy directories in "examples" to output directory + for dir in wdir.glob("examples/*"): + if dir.is_dir(): + (out_dir / dir.name).mkdir(exist_ok=True, parents=True) + for file in dir.glob("*"): + # copy, not move! + shutil.copy(out_dir / dir.name / file.name) + + # list of files to be processed + files = [f for f in wdir.glob("examples/*.py") if f.name not in EXCLUDE] + + + # process only modified files + if args.only_modified: + files = [f for f in files if is_modified(f, out_dir / f"{f.stem}.md")] + + print(files) + + # process files in parallel + with ThreadPoolExecutor(max_workers=args.max_workers) as executor: + + futures = [] + for file in files: + out_file = out_dir / f"{file.stem}.md" + futures.append(executor.submit(process_file, file, out_file=out_file, execute=args.execute)) + + for future in as_completed(futures): + try: + future.result() + except Exception as e: + print(f"Error processing file: {e}") + + +if __name__ == "__main__": + project_root = Path(__file__).parents[2] + + parser = ArgumentParser() + parser.add_argument("--max_workers", type=int, default=4) + parser.add_argument("--execute", action="store_true") + parser.add_argument("--only_modified", action="store_true") + parser.add_argument( + "--outdir", type=Path, default=project_root / "docs" / "_examples" + ) + args = parser.parse_args() + + main(args) diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index 14ac7b596..3e459d4b2 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -88,7 +88,16 @@ div.doc-contents:not(.first) { user-select: none; } +/* Centers all PNG images in markdown files */ +img[src$=".png"] { + display: block; + margin-left: auto; + margin-right: auto; +} + /* Maximum space for text block */ /* .md-grid { max-width: 65%; /* or 100%, if you want to stretch to full-width */ /* } + + From d25538f0b2c2dc97453a35c00d9d42fb37207a56 Mon Sep 17 00:00:00 2001 From: Francesco Zanetta Date: Mon, 15 Jul 2024 11:47:53 +0200 Subject: [PATCH 07/16] adapt relative paths in md files --- docs/index.md | 6 +++--- docs/sharp_bits.md | 16 +++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/docs/index.md b/docs/index.md index 2ee142c9f..7879bc8a3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,7 +4,7 @@ GPJax is a didactic Gaussian process (GP) library in JAX, supporting GPU acceleration and just-in-time compilation. We seek to provide a flexible API to enable researchers to rapidly prototype and develop new ideas. -![Gaussian process posterior.](./_static/GP.svg) +![Gaussian process posterior.](static/GP.svg) ## "Hello, GP!" @@ -40,7 +40,7 @@ would write on paper, as shown below. !!! Install - GPJax can be installed via pip. See our [installation guide](https://docs.jaxgaussianprocesses.com/installation/) for further details. + GPJax can be installed via pip. See our [installation guide](installation.md) for further details. ```bash pip install gpjax @@ -48,7 +48,7 @@ would write on paper, as shown below. !!! New - New to GPs? Then why not check out our [introductory notebook](https://docs.jaxgaussianprocesses.com/examples/intro_to_gps/) that starts from Bayes' theorem and univariate Gaussian distributions. + New to GPs? Then why not check out our [introductory notebook](_examples/intro_to_gps.md) that starts from Bayes' theorem and univariate Gaussian distributions. !!! Begin diff --git a/docs/sharp_bits.md b/docs/sharp_bits.md index be88beb0c..72aeb726b 100644 --- a/docs/sharp_bits.md +++ b/docs/sharp_bits.md @@ -60,7 +60,7 @@ learning rate is greater is than 0.03, we would end up with a negative variance We visualise this issue below where the red cross denotes the invalid lengthscale value that would be obtained, were we to optimise in the unconstrained parameter space. -![](_static/step_size_figure.svg) +![](static/step_size_figure.svg) A simple but impractical solution would be to use a tiny learning rate which would reduce the possibility of stepping outside of the parameter's support. However, this @@ -70,7 +70,7 @@ subspace of the real-line onto the entire real-line. Here, gradient updates are applied in the unconstrained parameter space before transforming the value back to the original support of the parameters. Such a transformation is known as a bijection. -![](_static/bijector_figure.svg) +![](static/bijector_figure.svg) To help understand this, we show the effect of using a log-exp bijector in the above figure. We have six points on the positive real line that range from 0.1 to 3 depicted @@ -81,8 +81,7 @@ value, we apply the inverse of the bijector, which is the exponential function i case. This gives us back the blue cross. In GPJax, we supply bijective functions using [Tensorflow Probability](https://www.tensorflow.org/probability/api_docs/python/tfp/substrates/jax/bijectors). -In our [PyTrees doc](examples/pytrees.md) document, we detail how the user can define -their own bijectors and attach them to the parameter(s) of their model. + ## Positive-definiteness @@ -91,8 +90,7 @@ their own bijectors and attach them to the parameter(s) of their model. ### Why is positive-definiteness important? The Gram matrix of a kernel, a concept that we explore more in our -[kernels notebook](examples/constructing_new_kernels.py) and our [PyTree notebook](examples/pytrees.md), is a -symmetric positive definite matrix. As such, we +[kernels notebook](_examples/constructing_new_kernels.md). As such, we have a range of tools at our disposal to make subsequent operations on the covariance matrix faster. One of these tools is the Cholesky factorisation that uniquely decomposes any symmetric positive-definite matrix $\mathbf{\Sigma}$ by @@ -158,7 +156,7 @@ for some problems, this amount may need to be increased. ## Slow-to-evaluate Famously, a regular Gaussian process model (as detailed in -[our regression notebook](examples/regression.py)) will scale cubically in the number of data points. +[our regression notebook](_examples/regression.md)) will scale cubically in the number of data points. Consequently, if you try to fit your Gaussian process model to a data set containing more than several thousand data points, then you will likely incur a significant computational overhead. In such cases, we recommend using Sparse Gaussian processes to @@ -168,7 +166,7 @@ When the data contains less than around 50000 data points, we recommend using the collapsed evidence lower bound objective [@titsias2009] to optimise the parameters of your sparse Gaussian process model. Such a model will scale linearly in the number of data points and quadratically in the number of inducing points. We demonstrate its use -in [our sparse regression notebook](examples/collapsed_vi.py). +in [our sparse regression notebook](_examples/collapsed_vi.md). For data sets exceeding 50000 data points, even the sparse Gaussian process outlined above will become computationally infeasible. In such cases, we recommend using the @@ -176,4 +174,4 @@ uncollapsed evidence lower bound objective [@hensman2013gaussian] that allows st mini-batch optimisation of the parameters of your sparse Gaussian process model. Such a model will scale linearly in the batch size and quadratically in the number of inducing points. We demonstrate its use in -[our sparse stochastic variational inference notebook](examples/uncollapsed_vi.py). +[our sparse stochastic variational inference notebook](_examples/uncollapsed_vi.md). From 741f7b44bcd44395fc3ee6c4bf27cf0bbf3cd73b Mon Sep 17 00:00:00 2001 From: Thomas-Christie Date: Mon, 15 Jul 2024 23:36:36 +0100 Subject: [PATCH 08/16] Update Ruff and incorporate changes --- poetry.lock | 85 ++++++++++++++++++++++++++++++----------------- pyproject.toml | 10 +++--- tests/test_gps.py | 4 +-- 3 files changed, 61 insertions(+), 38 deletions(-) diff --git a/poetry.lock b/poetry.lock index de2f16bde..0bea050e9 100644 --- a/poetry.lock +++ b/poetry.lock @@ -11,6 +11,17 @@ files = [ {file = "absl_py-2.1.0-py3-none-any.whl", hash = "sha256:526a04eadab8b4ee719ce68f204172ead1027549089702d99b9059f129ff1308"}, ] +[[package]] +name = "absolufy-imports" +version = "0.3.1" +description = "A tool to automatically replace relative imports with absolute ones." +optional = false +python-versions = ">=3.6.1" +files = [ + {file = "absolufy_imports-0.3.1-py2.py3-none-any.whl", hash = "sha256:49bf7c753a9282006d553ba99217f48f947e3eef09e18a700f8a82f75dc7fc5c"}, + {file = "absolufy_imports-0.3.1.tar.gz", hash = "sha256:c90638a6c0b66826d1fb4880ddc20ef7701af34192c94faf40b95d32b59f9793"}, +] + [[package]] name = "appnope" version = "0.1.4" @@ -176,6 +187,17 @@ files = [ [package.extras] dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] +[[package]] +name = "backports-strenum" +version = "1.3.1" +description = "Base class for creating enumerated constants that are also subclasses of str" +optional = false +python-versions = ">=3.8.6,<3.11" +files = [ + {file = "backports_strenum-1.3.1-py3-none-any.whl", hash = "sha256:cdcfe36dc897e2615dc793b7d3097f54d359918fc448754a517e6f23044ccf83"}, + {file = "backports_strenum-1.3.1.tar.gz", hash = "sha256:77c52407342898497714f0596e86188bb7084f89063226f4ba66863482f42414"}, +] + [[package]] name = "beartype" version = "0.16.4" @@ -891,13 +913,13 @@ lazy-imports = ["etils[ecolab]"] [[package]] name = "exceptiongroup" -version = "1.2.1" +version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, - {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, ] [package.extras] @@ -1135,16 +1157,17 @@ dev = ["flake8", "markdown", "twine", "wheel"] [[package]] name = "griffe" -version = "0.47.0" +version = "0.48.0" description = "Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API." optional = false python-versions = ">=3.8" files = [ - {file = "griffe-0.47.0-py3-none-any.whl", hash = "sha256:07a2fd6a8c3d21d0bbb0decf701d62042ccc8a576645c7f8799fe1f10de2b2de"}, - {file = "griffe-0.47.0.tar.gz", hash = "sha256:95119a440a3c932b13293538bdbc405bee4c36428547553dc6b327e7e7d35e5a"}, + {file = "griffe-0.48.0-py3-none-any.whl", hash = "sha256:f944c6ff7bd31cf76f264adcd6ab8f3d00a2f972ae5cc8db2d7b6dcffeff65a2"}, + {file = "griffe-0.48.0.tar.gz", hash = "sha256:f099461c02f016b6be4af386d5aa92b01fb4efe6c1c2c360dda9a5d0a863bb7f"}, ] [package.dependencies] +backports-strenum = {version = ">=1.3", markers = "python_version < \"3.11\""} colorama = ">=0.4" [[package]] @@ -2089,13 +2112,13 @@ mkdocs = ">=1.0.3" [[package]] name = "mkdocs-material" -version = "9.5.28" +version = "9.5.29" description = "Documentation that simply works" optional = false python-versions = ">=3.8" files = [ - {file = "mkdocs_material-9.5.28-py3-none-any.whl", hash = "sha256:ff48b11b2a9f705dd210409ec3b418ab443dd36d96915bcba45a41f10ea27bfd"}, - {file = "mkdocs_material-9.5.28.tar.gz", hash = "sha256:9cba305283ad1600e3d0a67abe72d7a058b54793b47be39930911a588fe0336b"}, + {file = "mkdocs_material-9.5.29-py3-none-any.whl", hash = "sha256:afc1f508e2662ded95f0a35a329e8a5acd73ee88ca07ba73836eb6fcdae5d8b4"}, + {file = "mkdocs_material-9.5.29.tar.gz", hash = "sha256:3e977598ec15a4ddad5c4dfc9e08edab6023edb51e88f0729bd27be77e3d322a"}, ] [package.dependencies] @@ -2171,13 +2194,12 @@ mkdocstrings = ">=0.25" [[package]] name = "mktestdocs" -version = "0.2.1" +version = "0.2.2" description = "" optional = false python-versions = "*" files = [ - {file = "mktestdocs-0.2.1-py2.py3-none-any.whl", hash = "sha256:55ad757e83227d5ba217eb285b8e44dc490601c4bbef52bc3331fea4510b72ec"}, - {file = "mktestdocs-0.2.1.tar.gz", hash = "sha256:44142b98223f02c7ba4629790d9ee83031fd4d8855577c6fbfc23103421d3872"}, + {file = "mktestdocs-0.2.2-py2.py3-none-any.whl", hash = "sha256:b0eea09c14cb9df7bf112f848c3d5069713519eddb3b0b2223211699246c3f1d"}, ] [package.extras] @@ -3631,28 +3653,29 @@ files = [ [[package]] name = "ruff" -version = "0.3.7" +version = "0.5.2" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.3.7-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:0e8377cccb2f07abd25e84fc5b2cbe48eeb0fea9f1719cad7caedb061d70e5ce"}, - {file = "ruff-0.3.7-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:15a4d1cc1e64e556fa0d67bfd388fed416b7f3b26d5d1c3e7d192c897e39ba4b"}, - {file = "ruff-0.3.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d28bdf3d7dc71dd46929fafeec98ba89b7c3550c3f0978e36389b5631b793663"}, - {file = "ruff-0.3.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:379b67d4f49774ba679593b232dcd90d9e10f04d96e3c8ce4a28037ae473f7bb"}, - {file = "ruff-0.3.7-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c060aea8ad5ef21cdfbbe05475ab5104ce7827b639a78dd55383a6e9895b7c51"}, - {file = "ruff-0.3.7-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:ebf8f615dde968272d70502c083ebf963b6781aacd3079081e03b32adfe4d58a"}, - {file = "ruff-0.3.7-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d48098bd8f5c38897b03604f5428901b65e3c97d40b3952e38637b5404b739a2"}, - {file = "ruff-0.3.7-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:da8a4fda219bf9024692b1bc68c9cff4b80507879ada8769dc7e985755d662ea"}, - {file = "ruff-0.3.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c44e0149f1d8b48c4d5c33d88c677a4aa22fd09b1683d6a7ff55b816b5d074f"}, - {file = "ruff-0.3.7-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:3050ec0af72b709a62ecc2aca941b9cd479a7bf2b36cc4562f0033d688e44fa1"}, - {file = "ruff-0.3.7-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:a29cc38e4c1ab00da18a3f6777f8b50099d73326981bb7d182e54a9a21bb4ff7"}, - {file = "ruff-0.3.7-py3-none-musllinux_1_2_i686.whl", hash = "sha256:5b15cc59c19edca917f51b1956637db47e200b0fc5e6e1878233d3a938384b0b"}, - {file = "ruff-0.3.7-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:e491045781b1e38b72c91247cf4634f040f8d0cb3e6d3d64d38dcf43616650b4"}, - {file = "ruff-0.3.7-py3-none-win32.whl", hash = "sha256:bc931de87593d64fad3a22e201e55ad76271f1d5bfc44e1a1887edd0903c7d9f"}, - {file = "ruff-0.3.7-py3-none-win_amd64.whl", hash = "sha256:5ef0e501e1e39f35e03c2acb1d1238c595b8bb36cf7a170e7c1df1b73da00e74"}, - {file = "ruff-0.3.7-py3-none-win_arm64.whl", hash = "sha256:789e144f6dc7019d1f92a812891c645274ed08af6037d11fc65fcbc183b7d59f"}, - {file = "ruff-0.3.7.tar.gz", hash = "sha256:d5c1aebee5162c2226784800ae031f660c350e7a3402c4d1f8ea4e97e232e3ba"}, + {file = "ruff-0.5.2-py3-none-linux_armv6l.whl", hash = "sha256:7bab8345df60f9368d5f4594bfb8b71157496b44c30ff035d1d01972e764d3be"}, + {file = "ruff-0.5.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:1aa7acad382ada0189dbe76095cf0a36cd0036779607c397ffdea16517f535b1"}, + {file = "ruff-0.5.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:aec618d5a0cdba5592c60c2dee7d9c865180627f1a4a691257dea14ac1aa264d"}, + {file = "ruff-0.5.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0b62adc5ce81780ff04077e88bac0986363e4a3260ad3ef11ae9c14aa0e67ef"}, + {file = "ruff-0.5.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:dc42ebf56ede83cb080a50eba35a06e636775649a1ffd03dc986533f878702a3"}, + {file = "ruff-0.5.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c15c6e9f88c67ffa442681365d11df38afb11059fc44238e71a9d9f1fd51de70"}, + {file = "ruff-0.5.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:d3de9a5960f72c335ef00763d861fc5005ef0644cb260ba1b5a115a102157251"}, + {file = "ruff-0.5.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fe5a968ae933e8f7627a7b2fc8893336ac2be0eb0aace762d3421f6e8f7b7f83"}, + {file = "ruff-0.5.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a04f54a9018f75615ae52f36ea1c5515e356e5d5e214b22609ddb546baef7132"}, + {file = "ruff-0.5.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ed02fb52e3741f0738db5f93e10ae0fb5c71eb33a4f2ba87c9a2fa97462a649"}, + {file = "ruff-0.5.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:3cf8fe659f6362530435d97d738eb413e9f090e7e993f88711b0377fbdc99f60"}, + {file = "ruff-0.5.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:237a37e673e9f3cbfff0d2243e797c4862a44c93d2f52a52021c1a1b0899f846"}, + {file = "ruff-0.5.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:2a2949ce7c1cbd8317432ada80fe32156df825b2fd611688814c8557824ef060"}, + {file = "ruff-0.5.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:481af57c8e99da92ad168924fd82220266043c8255942a1cb87958b108ac9335"}, + {file = "ruff-0.5.2-py3-none-win32.whl", hash = "sha256:f1aea290c56d913e363066d83d3fc26848814a1fed3d72144ff9c930e8c7c718"}, + {file = "ruff-0.5.2-py3-none-win_amd64.whl", hash = "sha256:8532660b72b5d94d2a0a7a27ae7b9b40053662d00357bb2a6864dd7e38819084"}, + {file = "ruff-0.5.2-py3-none-win_arm64.whl", hash = "sha256:73439805c5cb68f364d826a5c5c4b6c798ded6b7ebaa4011f01ce6c94e4d5583"}, + {file = "ruff-0.5.2.tar.gz", hash = "sha256:2c0df2d2de685433794a14d8d2e240df619b748fbe3367346baa519d8e6f1ca2"}, ] [[package]] @@ -4141,4 +4164,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.12" -content-hash = "e66211ae5b75381517e713944e270de9f6774da7f9d139781bdc926401bba7f1" +content-hash = "cf389d14ca30272cf9b8d08cddce7996ec75d922cbc4322bff9522c2e7d6e714" diff --git a/pyproject.toml b/pyproject.toml index 42e11de4f..268e8ee28 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ flax = "^0.8.4" numpy = "<2.0.0" [tool.poetry.group.dev.dependencies] -ruff = "^0.3.0" +ruff = "~0" pre-commit = "^3.2.2" interrogate = "^1.5.0" codespell = "^2.2.4" @@ -39,6 +39,7 @@ pytest-cov = "^4.0.0" pytest-pretty = "^1.1.1" pytest-xdist = "^3.2.1" coverage = "^7.2.2" +absolufy-imports = "^0.3.1" xdoctest = "^1.1.1" mktestdocs = "^0.2.1" asv = "^0.6.0" @@ -83,11 +84,13 @@ xfail_strict = true [tool.ruff] # https://github.com/charliermarsh/ruff fix = true cache-dir = "~/.cache/ruff" +exclude = ["docs/", "examples/"] line-length = 88 src = ["gpjax", "tests"] target-version = "py38" [tool.ruff.lint] +dummy-variable-rgx = "^_$" select = [ "F", # pycodestyle @@ -122,7 +125,7 @@ ignore = [ # do not assign a lambda expression, use a def "E731", "E501", - "S303", + "S307", "RET504", "S101", "F722", @@ -130,9 +133,6 @@ ignore = [ "PLR0913", ] unfixable = ["ERA001", "F401", "F841", "T201", "T203"] -exclude = ["docs/"] -ignore-init-module-imports = true -dummy-variable-rgx = "^_$" [tool.ruff.lint.pydocstyle] convention = "numpy" diff --git a/tests/test_gps.py b/tests/test_gps.py index 7d01cd17d..708ae08c4 100644 --- a/tests/test_gps.py +++ b/tests/test_gps.py @@ -211,8 +211,8 @@ def test_posterior_construct( posterior_manual = construct_posterior(prior=prior, likelihood=likelihood) # Ensure that the posterior is the same type in all three cases. - assert type(posterior_mul) == type(posterior_rmul) - assert type(posterior_mul) == type(posterior_manual) + assert type(posterior_mul) is type(posterior_rmul) + assert type(posterior_mul) is type(posterior_manual) # Ensure we have the correct likelihood and prior. assert posterior_mul.likelihood == likelihood From d50f015ed8ff95b190f9abff5ee86ba84edc917f Mon Sep 17 00:00:00 2001 From: Francesco Zanetta Date: Thu, 18 Jul 2024 15:33:20 +0200 Subject: [PATCH 09/16] update github workflow for building doc, without executing notebookf for now --- .github/workflows/test_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_docs.yml b/.github/workflows/test_docs.yml index bbf7f5b4c..a82287235 100644 --- a/.github/workflows/test_docs.yml +++ b/.github/workflows/test_docs.yml @@ -61,4 +61,4 @@ jobs: cp docs/examples/gpjax.mplstyle . poetry install --all-extras --with docs conda install pandoc - poetry run mkdocs build + poetry run python docs/scripts/gen_examples.py && poetry run mkdocs build From 357ffb18ea959ae72c705e0ab028450ee7bc4f32 Mon Sep 17 00:00:00 2001 From: Thomas Pinder Date: Thu, 15 Aug 2024 22:11:28 +0200 Subject: [PATCH 10/16] Fix e2e tests --- tests/integration_tests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration_tests.py b/tests/integration_tests.py index 2ec803a06..bc99facd0 100644 --- a/tests/integration_tests.py +++ b/tests/integration_tests.py @@ -75,7 +75,7 @@ def test(self): regression = Result( - path="docs/examples/regression.py", + path="examples/regression.py", comparisons={ "history": (55.07405622, get_last), "predictive_mean": (36.24383416, jnp.sum), @@ -85,7 +85,7 @@ def test(self): regression.test() sparse = Result( - path="docs/examples/collapsed_vi.py", + path="examples/collapsed_vi.py", comparisons={ "history": (1924.7634809, get_last), "predictive_mean": (-8.39869652, jnp.sum), @@ -95,7 +95,7 @@ def test(self): sparse.test() stochastic = Result( - path="docs/examples/uncollapsed_vi.py", + path="examples/uncollapsed_vi.py", comparisons={ "history": (-2678.41302494, get_last), "meanf": (-54.14787028, jnp.sum), From 7a0ad3ba3a7ae09c5784758d35c207d17648aac3 Mon Sep 17 00:00:00 2001 From: Thomas Pinder Date: Thu, 15 Aug 2024 22:19:12 +0200 Subject: [PATCH 11/16] Fix mplstyle refs --- .github/workflows/build_docs.yml | 1 - .github/workflows/test_docs.yml | 1 - docs/scripts/sharp_bits_figure.py | 4 +++- examples/barycentres.py | 5 +++-- examples/regression.py | 8 +++++--- examples/utils.py | 5 ----- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 539989456..ba4161ca2 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -59,7 +59,6 @@ jobs: - name: Build the documentation with MKDocs run: | - cp docs/examples/gpjax.mplstyle . poetry install --all-extras --with docs conda install pandoc poetry run mkdocs build diff --git a/.github/workflows/test_docs.yml b/.github/workflows/test_docs.yml index a82287235..54a82a6d2 100644 --- a/.github/workflows/test_docs.yml +++ b/.github/workflows/test_docs.yml @@ -58,7 +58,6 @@ jobs: - name: Build the documentation with MKDocs run: | - cp docs/examples/gpjax.mplstyle . poetry install --all-extras --with docs conda install pandoc poetry run python docs/scripts/gen_examples.py && poetry run mkdocs build diff --git a/docs/scripts/sharp_bits_figure.py b/docs/scripts/sharp_bits_figure.py index 49c2a2c7b..ef0622d52 100644 --- a/docs/scripts/sharp_bits_figure.py +++ b/docs/scripts/sharp_bits_figure.py @@ -20,7 +20,9 @@ import matplotlib as mpl from matplotlib import patches -plt.style.use("../examples/gpjax.mplstyle") +plt.style.use( + "https://raw.githubusercontent.com/JaxGaussianProcesses/GPJax/main/docs/examples/gpjax.mplstyle" +) cols = mpl.rcParams["axes.prop_cycle"].by_key()["color"] # %% diff --git a/examples/barycentres.py b/examples/barycentres.py index a850a1b6a..83e664de0 100644 --- a/examples/barycentres.py +++ b/examples/barycentres.py @@ -44,7 +44,6 @@ from jaxtyping import install_import_hook import matplotlib.pyplot as plt import tensorflow_probability.substrates.jax.distributions as tfd -from examples.utils import mpl_use_gpjaxstyle with install_import_hook("gpjax", "beartype.beartype"): import gpjax as gpx @@ -53,7 +52,9 @@ key = jr.key(123) # set the default style for plotting -mpl_use_gpjaxstyle() +plt.style.use( + "https://raw.githubusercontent.com/JaxGaussianProcesses/GPJax/main/docs/examples/gpjax.mplstyle" +) cols = plt.rcParams["axes.prop_cycle"].by_key()["color"] diff --git a/examples/regression.py b/examples/regression.py index 4a7ecd507..bf777b1e4 100644 --- a/examples/regression.py +++ b/examples/regression.py @@ -30,7 +30,7 @@ from jaxtyping import install_import_hook import matplotlib as mpl import matplotlib.pyplot as plt -from examples.utils import clean_legend, mpl_use_gpjaxstyle +from examples.utils import clean_legend with install_import_hook("gpjax", "beartype.beartype"): import gpjax as gpx @@ -38,7 +38,9 @@ key = jr.key(123) # set the default style for plotting -mpl_use_gpjaxstyle() +plt.style.use( + "https://raw.githubusercontent.com/JaxGaussianProcesses/GPJax/main/docs/examples/gpjax.mplstyle" +) cols = mpl.rcParams["axes.prop_cycle"].by_key()["color"] @@ -56,7 +58,7 @@ # %% n = 100 -noise = 0.3 +noise = 0.3 key, subkey = jr.split(key) x = jr.uniform(key=key, minval=-3.0, maxval=3.0, shape=(n,)).reshape(-1, 1) diff --git a/examples/utils.py b/examples/utils.py index 539a7bcfa..b9ccaa65f 100644 --- a/examples/utils.py +++ b/examples/utils.py @@ -73,8 +73,3 @@ def clean_legend(ax): by_label = dict(zip(labels, handles)) ax.legend(by_label.values(), by_label.keys()) return ax - - -def mpl_use_gpjaxstyle(): - - plt.style.use(Path(__file__).parent / "gpjax.mplstyle") \ No newline at end of file From 939f9034c3baf87b313b17132c8ac82f1103b9ad Mon Sep 17 00:00:00 2001 From: Thomas Pinder Date: Thu, 15 Aug 2024 22:29:04 +0200 Subject: [PATCH 12/16] bump deps --- poetry.lock | 23 ++++------------------- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/poetry.lock b/poetry.lock index cddd016de..1141e1264 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1808,18 +1808,17 @@ testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] [[package]] name = "markdown-katex" -version = "202112.1034" +version = "202406.1035" description = "katex extension for Python Markdown" optional = false python-versions = ">=2.7" files = [ - {file = "markdown-katex-202112.1034.tar.gz", hash = "sha256:27892f4cdd6763816f00e4187d0475500697c090aba16630ec4803a6564bf810"}, - {file = "markdown_katex-202112.1034-py2.py3-none-any.whl", hash = "sha256:9ccc5b4b37db7592cc3ea113d763fafe9ffd1b1587e2c217d6145e44a10b4f6d"}, + {file = "markdown-katex-202406.1035.tar.gz", hash = "sha256:e82f7bf9a8536451da8f01768d847516fa1827feb17140b8eaa0bea9826bdab0"}, + {file = "markdown_katex-202406.1035-py2.py3-none-any.whl", hash = "sha256:c1713e85854ddecb641ad96243a8b6cd67367bf1bf8d39b43b3680d7f2b1884d"}, ] [package.dependencies] Markdown = {version = ">=3.0", markers = "python_version >= \"3.6\""} -pathlib2 = "*" setuptools = "*" [[package]] @@ -2756,20 +2755,6 @@ files = [ qa = ["flake8 (==5.0.4)", "mypy (==0.971)", "types-setuptools (==67.2.0.1)"] testing = ["docopt", "pytest"] -[[package]] -name = "pathlib2" -version = "2.3.7.post1" -description = "Object-oriented filesystem paths" -optional = false -python-versions = "*" -files = [ - {file = "pathlib2-2.3.7.post1-py2.py3-none-any.whl", hash = "sha256:5266a0fd000452f1b3467d782f079a4343c63aaa119221fbdc4e39577489ca5b"}, - {file = "pathlib2-2.3.7.post1.tar.gz", hash = "sha256:9fe0edad898b83c0c3e199c842b27ed216645d2e177757b2dd67384d4113c641"}, -] - -[package.dependencies] -six = "*" - [[package]] name = "pathspec" version = "0.12.1" @@ -4228,4 +4213,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.12" -content-hash = "cf389d14ca30272cf9b8d08cddce7996ec75d922cbc4322bff9522c2e7d6e714" +content-hash = "4b2ae7bad45029e7becc027913e0adbf40d21a2632971f4eb50c3a4096f20766" diff --git a/pyproject.toml b/pyproject.toml index b3d124a51..82a757eda 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,6 @@ mkdocs-jupyter = "^0.24.3" mkdocs-gen-files = "^0.5.0" mkdocs-literate-nav = "^0.6.0" mkdocs-git-authors-plugin = "^0.7.0" -markdown-katex = "^202112.1034" matplotlib = "^3.7.1" seaborn = "^0.12.2" networkx = "^3.0" @@ -66,6 +65,7 @@ ipywidgets = "^8.0.5" pandas = "^1.5.3" pymdown-extensions = "^10.7.1" nbconvert = "^7.16.2" +markdown-katex = "^202406.1035" [build-system] requires = ["poetry-core"] From 8ddee1f1f6f1cd1ac3aca7b240ac9814af348a79 Mon Sep 17 00:00:00 2001 From: Thomas Pinder Date: Thu, 15 Aug 2024 22:36:15 +0200 Subject: [PATCH 13/16] Update poetry --- .github/workflows/build_docs.yml | 2 +- .github/workflows/integration.yml | 2 +- .github/workflows/test_docs.yml | 2 +- .github/workflows/tests.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index ba4161ca2..433d4e345 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -47,7 +47,7 @@ jobs: - name: Install and configure Poetry uses: snok/install-poetry@v1 with: - version: 1.2.2 + version: 1.5.1 virtualenvs-create: false virtualenvs-in-project: false installer-parallel: true diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4a71d8969..5aa90b148 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -29,7 +29,7 @@ jobs: - name: Install Poetry uses: snok/install-poetry@v1.3.3 with: - version: 1.4.0 + version: 1.5.1 # Configure Poetry to use the virtual environment in the project - name: Setup Poetry diff --git a/.github/workflows/test_docs.yml b/.github/workflows/test_docs.yml index 54a82a6d2..9dc9c55d5 100644 --- a/.github/workflows/test_docs.yml +++ b/.github/workflows/test_docs.yml @@ -51,7 +51,7 @@ jobs: - name: Install and configure Poetry uses: snok/install-poetry@v1 with: - version: 1.2.2 + version: 1.5.1 virtualenvs-create: false virtualenvs-in-project: false installer-parallel: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b3d747e90..5b2fa924b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,7 +29,7 @@ jobs: - name: Install Poetry uses: snok/install-poetry@v1.3.3 with: - version: 1.4.0 + version: 1.5.1 # Configure Poetry to use the virtual environment in the project - name: Setup Poetry From 767cef22305fa7981fd914d8ef123f2baaae4b06 Mon Sep 17 00:00:00 2001 From: Thomas Pinder Date: Thu, 15 Aug 2024 22:43:38 +0200 Subject: [PATCH 14/16] Update poetry --- .github/workflows/tests.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5b2fa924b..967896bf5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,10 +26,13 @@ jobs: python-version: ${{ matrix.python-version }} # Install Poetry - - name: Install Poetry - uses: snok/install-poetry@v1.3.3 + - name: Install and configure Poetry + uses: snok/install-poetry@v1 with: version: 1.5.1 + virtualenvs-create: false + virtualenvs-in-project: false + installer-parallel: true # Configure Poetry to use the virtual environment in the project - name: Setup Poetry @@ -39,7 +42,7 @@ jobs: # Install the dependencies - name: Install Package run: | - poetry install --with tests + poetry install --with dev - name: Check docstrings run: | From 81a6b988d304967c9c1d1781fd4a4e2b520abe35 Mon Sep 17 00:00:00 2001 From: Thomas Pinder Date: Thu, 15 Aug 2024 22:52:46 +0200 Subject: [PATCH 15/16] Fix shutil --- docs/scripts/gen_examples.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/docs/scripts/gen_examples.py b/docs/scripts/gen_examples.py index cc27fc31b..8fbe71b46 100644 --- a/docs/scripts/gen_examples.py +++ b/docs/scripts/gen_examples.py @@ -1,6 +1,6 @@ -""" Convert python files in "examples" directory to markdown files using jupytext and nbconvert. +""" Convert python files in "examples" directory to markdown files using jupytext and nbconvert. -There's only a minor inconvenience with how supporting files are handled by nbconvert, +There's only a minor inconvenience with how supporting files are handled by nbconvert, see https://github.com/jupyter/nbconvert/issues/1164. But these will be under a private directory `_examples` in the docs folder, so it's not a big deal. @@ -13,10 +13,10 @@ EXCLUDE = ["utils.py"] + def process_file(file: Path, out_file: Path | None = None, execute: bool = False): """Converts a python file to markdown using jupytext and nbconvert.""" - out_dir = out_file.parent command = f"cd {out_dir.as_posix()} && " @@ -39,28 +39,24 @@ def is_modified(file: Path, out_file: Path): def main(args): - # project root directory wdir = Path(__file__).parents[2] - # output directory out_dir: Path = args.outdir out_dir.mkdir(exist_ok=True, parents=True) - # copy directories in "examples" to output directory for dir in wdir.glob("examples/*"): if dir.is_dir(): (out_dir / dir.name).mkdir(exist_ok=True, parents=True) for file in dir.glob("*"): # copy, not move! - shutil.copy(out_dir / dir.name / file.name) + shutil.copy(file, out_dir / dir.name / file.name) # list of files to be processed files = [f for f in wdir.glob("examples/*.py") if f.name not in EXCLUDE] - # process only modified files if args.only_modified: files = [f for f in files if is_modified(f, out_dir / f"{f.stem}.md")] @@ -69,12 +65,15 @@ def main(args): # process files in parallel with ThreadPoolExecutor(max_workers=args.max_workers) as executor: - futures = [] for file in files: out_file = out_dir / f"{file.stem}.md" - futures.append(executor.submit(process_file, file, out_file=out_file, execute=args.execute)) - + futures.append( + executor.submit( + process_file, file, out_file=out_file, execute=args.execute + ) + ) + for future in as_completed(futures): try: future.result() From e38d5bb4c826f8629476434d850fb5b62cae31ee Mon Sep 17 00:00:00 2001 From: Thomas Pinder Date: Thu, 15 Aug 2024 23:00:42 +0200 Subject: [PATCH 16/16] Drop flax base --- gpjax/flax_base/bijectors.py | 8 -------- gpjax/flax_base/param.py | 19 ------------------- gpjax/flax_base/types.py | 18 ------------------ 3 files changed, 45 deletions(-) delete mode 100644 gpjax/flax_base/bijectors.py delete mode 100644 gpjax/flax_base/param.py delete mode 100644 gpjax/flax_base/types.py diff --git a/gpjax/flax_base/bijectors.py b/gpjax/flax_base/bijectors.py deleted file mode 100644 index 3b4d96589..000000000 --- a/gpjax/flax_base/bijectors.py +++ /dev/null @@ -1,8 +0,0 @@ -import tensorflow_probability.substrates.jax.bijectors as tfb - -from gpjax.flax_base.types import BijectorLookupType - -Bijectors: BijectorLookupType = { - "real": tfb.Identity(), - "positive": tfb.Softplus(), -} diff --git a/gpjax/flax_base/param.py b/gpjax/flax_base/param.py deleted file mode 100644 index ff5204a02..000000000 --- a/gpjax/flax_base/param.py +++ /dev/null @@ -1,19 +0,0 @@ -from flax import nnx -import jax.numpy as jnp - -from gpjax.flax_base.types import ( - A, - DomainType, -) - - -class AbstractParameter(nnx.Variable[A]): - domain: DomainType = "real" - static: bool = False - - def __init__(self, value: A, *args, **kwargs): - super().__init__(jnp.asarray(value), *args, **kwargs) - - -class PositiveParameter(AbstractParameter[A]): - domain: DomainType = "positive" diff --git a/gpjax/flax_base/types.py b/gpjax/flax_base/types.py deleted file mode 100644 index b51b8ec7f..000000000 --- a/gpjax/flax_base/types.py +++ /dev/null @@ -1,18 +0,0 @@ -import typing as tp - -import tensorflow_probability.substrates.jax.bijectors as tfb - -DomainType = tp.Literal["real", "positive"] -A = tp.TypeVar("A") - - -# class BijectorLookup(tp.TypedDict): -# domain: DomainType -# bijector: tfb.Bijector - - -class BijectorLookupType(tp.Dict[DomainType, tfb.Bijector]): - pass - - -__all__ = ["DomainType", "A", "BijectorLookupType"]