diff --git a/docs/source/tutorials/day_of_the_week.qmd b/docs/source/tutorials/day_of_the_week.qmd index 0b96008f..f6558698 100644 --- a/docs/source/tutorials/day_of_the_week.qmd +++ b/docs/source/tutorials/day_of_the_week.qmd @@ -283,8 +283,6 @@ As a result, we can see the posterior distribution of our novel day-of-the-week out = hosp_model_dow.plot_posterior( var="dayofweek_effect_raw", ylab="Day of the Week Effect", samples=500 ) - -sp = hosp_model_dow.spread_draws(["dayofweek_effect"]) ``` The new model with the day-of-the-week effect can be compared to the previous model without the effect. Finally, let's reproduce the figure without the day-of-the-week effect, and then plot the new model with the effect: diff --git a/test/test_model_basic_renewal.py b/test/test_model_basic_renewal.py index dfc33c3b..5aaf2cce 100644 --- a/test/test_model_basic_renewal.py +++ b/test/test_model_basic_renewal.py @@ -7,7 +7,6 @@ import numpy as np import numpyro import numpyro.distributions as dist -import polars as pl import pytest from pyrenew.deterministic import DeterministicPMF, NullObservation @@ -157,17 +156,6 @@ def test_model_basicrenewal_no_obs_model(): data_observed_infections=model0_samp.latent_infections, ) - inf = model0.spread_draws(["all_latent_infections"]) - inf_mean = ( - inf.group_by("draw") - .agg(pl.col("all_latent_infections").mean()) - .sort(pl.col("draw")) - ) - - # For now the assertion is only about the expected number of rows - # It should be about the MCMC inference. - assert inf_mean.to_numpy().shape[0] == 500 - def test_model_basicrenewal_with_obs_model(): """ @@ -215,17 +203,6 @@ def test_model_basicrenewal_with_obs_model(): data_observed_infections=model1_samp.observed_infections, ) - inf = model1.spread_draws(["all_latent_infections"]) - inf_mean = ( - inf.group_by("draw") - .agg(pl.col("all_latent_infections").mean()) - .sort(pl.col("draw")) - ) - - # For now the assertion is only about the expected number of rows - # It should be about the MCMC inference. - assert inf_mean.to_numpy().shape[0] == 500 - def test_model_basicrenewal_padding() -> None: # numpydoc ignore=GL08 gen_int = DeterministicPMF( @@ -264,15 +241,3 @@ def test_model_basicrenewal_padding() -> None: # numpydoc ignore=GL08 data_observed_infections=model1_samp.observed_infections, padding=pad_size, ) - - inf = model1.spread_draws(["all_latent_infections"]) - - inf_mean = ( - inf.group_by("draw") - .agg(pl.col("all_latent_infections").mean()) - .sort(pl.col("draw")) - ) - - # For now the assertion is only about the expected number of rows - # It should be about the MCMC inference. - assert inf_mean.to_numpy().shape[0] == 500 diff --git a/test/test_model_hosp_admissions.py b/test/test_model_hosp_admissions.py index 4aed146c..60293b07 100644 --- a/test/test_model_hosp_admissions.py +++ b/test/test_model_hosp_admissions.py @@ -7,7 +7,6 @@ import numpy as np import numpyro import numpyro.distributions as dist -import polars as pl import pytest from pyrenew.deterministic import ( @@ -255,17 +254,6 @@ def test_model_hosp_no_obs_model(): data_observed_hosp_admissions=model0_samp.latent_hosp_admissions, ) - inf = model0.spread_draws(["latent_hospital_admissions"]) - inf_mean = ( - inf.group_by("draw") - .agg(pl.col("latent_hospital_admissions").mean()) - .sort(pl.col("draw")) - ) - - # For now the assertion is only about the expected number of rows - # It should be about the MCMC inference. - assert inf_mean.to_numpy().shape[0] == 500 - def test_model_hosp_with_obs_model(): """ @@ -342,17 +330,6 @@ def test_model_hosp_with_obs_model(): data_observed_hosp_admissions=model1_samp.observed_hosp_admissions, ) - inf = model1.spread_draws(["latent_hospital_admissions"]) - inf_mean = ( - inf.group_by("draw") - .agg(pl.col("latent_hospital_admissions").mean()) - .sort(pl.col("draw")) - ) - - # For now the assertion is only about the expected number of rows - # It should be about the MCMC inference. - assert inf_mean.to_numpy().shape[0] == 500 - def test_model_hosp_with_obs_model_weekday_phosp_2(): """ @@ -436,17 +413,6 @@ def test_model_hosp_with_obs_model_weekday_phosp_2(): data_observed_hosp_admissions=model1_samp.observed_hosp_admissions, ) - inf = model1.spread_draws(["latent_hospital_admissions"]) - inf_mean = ( - inf.group_by("draw") - .agg(pl.col("latent_hospital_admissions").mean()) - .sort(pl.col("draw")) - ) - - # For now the assertion is only about the expected number of rows - # It should be about the MCMC inference. - assert inf_mean.to_numpy().shape[0] == 500 - def test_model_hosp_with_obs_model_weekday_phosp(): """ @@ -558,14 +524,3 @@ def test_model_hosp_with_obs_model_weekday_phosp(): data_observed_hosp_admissions=model1_samp.observed_hosp_admissions, padding=pad_size, ) - - inf = model1.spread_draws(["latent_hospital_admissions"]) - inf_mean = ( - inf.group_by("draw") - .agg(pl.col("latent_hospital_admissions").mean()) - .sort(pl.col("draw")) - ) - - # For now the assertion is only about the expected number of rows - # It should be about the MCMC inference. - assert inf_mean.to_numpy().shape[0] == 500