From d92daef05552d9875194aff4688ca3aac7bdc667 Mon Sep 17 00:00:00 2001 From: Michael Osthege Date: Wed, 13 Aug 2025 14:13:21 +0200 Subject: [PATCH] Use `pm.Data` instead of deprecated `pm.ConstantData` --- bletl/growth.py | 10 +++++----- ...ayesian Analysis of time-Variable Growth Rate.ipynb | 2 +- pyproject.toml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bletl/growth.py b/bletl/growth.py index 1a0a96a..8f818e5 100644 --- a/bletl/growth.py +++ b/bletl/growth.py @@ -352,10 +352,10 @@ def fit_mu_t( "segment": numpy.arange(TS), } with pm.Model(coords=coords) as pmodel: - pm.ConstantData("known_switchpoints", t_switchpoints_known) - pm.ConstantData("t_data", t_data, dims="timepoint") - pm.ConstantData("t_segments", t_segments, dims="segment") - dt = pm.ConstantData("dt", numpy.diff(t_data), dims="segment") + pm.Data("known_switchpoints", t_switchpoints_known) + pm.Data("t_data", t_data, dims="timepoint") + pm.Data("t_segments", t_segments, dims="segment") + dt = pm.Data("dt", numpy.diff(t_data), dims="segment") # The init dist for the random walk is where each segment starts. # Here we center it on the user-provided mu_prior, @@ -428,7 +428,7 @@ def fit_mu_t( ) calibration_model.loglikelihood( x=Xt, - y=pm.ConstantData("backscatter", y, dims=("timepoint",)), + y=pm.Data("backscatter", y, dims=("timepoint",)), name=f"{replicate_id}_{calibration_model.dependent_key}", dims="timepoint", ) diff --git a/notebooks/Quickstart_04_Bayesian Analysis of time-Variable Growth Rate.ipynb b/notebooks/Quickstart_04_Bayesian Analysis of time-Variable Growth Rate.ipynb index 8c3cf53..448050c 100644 --- a/notebooks/Quickstart_04_Bayesian Analysis of time-Variable Growth Rate.ipynb +++ b/notebooks/Quickstart_04_Bayesian Analysis of time-Variable Growth Rate.ipynb @@ -303,7 +303,7 @@ "outputs": [ { "data": { - "image/svg+xml": "\n\n\n\n\n\n\n\ncluster101\n\n101\n\n\ncluster72\n\n72\n\n\ncluster1\n\n1\n\n\nclustersegment (173)\n\nsegment (173)\n\n\nclustertimepoint (174)\n\ntimepoint (174)\n\n\n\nknown_switchpoints\n\nknown_switchpoints\n~\nConstantData\n\n\n\nunnamed.BS3\n\nunnamed.BS3\n~\nStudentT\n\n\n\nbackscatter\n\nbackscatter\n~\nConstantData\n\n\n\nunnamed.BS3->backscatter\n\n\n\n\n\nX\n\nX\n~\nDeterministic\n\n\n\nX->unnamed.BS3\n\n\n\n\n\nt_data\n\nt_data\n~\nConstantData\n\n\n\nmu_t\n\nmu_t\n~\nDeterministic\n\n\n\nmu_t->X\n\n\n\n\n\ndt\n\ndt\n~\nConstantData\n\n\n\ndt->X\n\n\n\n\n\nt_segments\n\nt_segments\n~\nConstantData\n\n\n\nmu_phase_0\n\nmu_phase_0\n~\nRandomWalk\n\n\n\nmu_phase_0->mu_t\n\n\n\n\n\nmu_phase_1\n\nmu_phase_1\n~\nRandomWalk\n\n\n\nmu_phase_1->mu_t\n\n\n\n\n\nX0\n\nX0\n~\nLogNormal\n\n\n\nX0->X\n\n\n\n\n\n", + "image/svg+xml": "\n\n\n\n\n\n\n\ncluster101\n\n101\n\n\ncluster72\n\n72\n\n\ncluster1\n\n1\n\n\nclustersegment (173)\n\nsegment (173)\n\n\nclustertimepoint (174)\n\ntimepoint (174)\n\n\n\nknown_switchpoints\n\nknown_switchpoints\n~\nData\n\n\n\nunnamed.BS3\n\nunnamed.BS3\n~\nStudentT\n\n\n\nbackscatter\n\nbackscatter\n~\nData\n\n\n\nunnamed.BS3->backscatter\n\n\n\n\n\nX\n\nX\n~\nDeterministic\n\n\n\nX->unnamed.BS3\n\n\n\n\n\nt_data\n\nt_data\n~\nData\n\n\n\nmu_t\n\nmu_t\n~\nDeterministic\n\n\n\nmu_t->X\n\n\n\n\n\ndt\n\ndt\n~\nData\n\n\n\ndt->X\n\n\n\n\n\nt_segments\n\nt_segments\n~\nData\n\n\n\nmu_phase_0\n\nmu_phase_0\n~\nRandomWalk\n\n\n\nmu_phase_0->mu_t\n\n\n\n\n\nmu_phase_1\n\nmu_phase_1\n~\nRandomWalk\n\n\n\nmu_phase_1->mu_t\n\n\n\n\n\nX0\n\nX0\n~\nLogNormal\n\n\n\nX0->X\n\n\n\n\n\n", "text/plain": [ "" ] diff --git a/pyproject.toml b/pyproject.toml index 81462c3..3a4cd51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "bletl" -version = "1.6.0" +version = "1.6.1" description = "Package for parsing and transforming BioLector raw data." readme = "README.md" requires-python = ">=3.8"