Skip to content

Commit 08f5a42

Browse files
junpenglaoclaude
andauthored
Rename tests/util.py to tests/fixtures.py for clarity (#851)
`util.py` was ambiguous — it looked like it might test `blackjax/util.py` (which `test_util.py` actually does). `fixtures.py` signals shared test infrastructure (base class, helpers) following pytest conventions. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c93f445 commit 08f5a42

21 files changed

Lines changed: 20 additions & 20 deletions

tests/adaptation/test_low_rank_adaptation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import blackjax
2121
from blackjax.adaptation.low_rank_adaptation import _compute_low_rank_metric, _spd_mean
22-
from tests.util import BlackJAXTest
22+
from tests.fixtures import BlackJAXTest
2323

2424

2525
class SPDMeanTest(BlackJAXTest):

tests/adaptation/test_meads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import blackjax
99
from blackjax.adaptation.meads_adaptation import MEADSAdaptationState, base
10-
from tests.util import BlackJAXTest
10+
from tests.fixtures import BlackJAXTest
1111

1212

1313
def make_logdensity(dim=2):
File renamed without changes.

tests/mcmc/test_elliptical_slice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
ellipsis,
2727
init,
2828
)
29-
from tests.util import BlackJAXTest, std_normal_logdensity
29+
from tests.fixtures import BlackJAXTest, std_normal_logdensity
3030

3131
# ---------------------------------------------------------------------------
3232
# ellipsis geometry

tests/mcmc/test_mala.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import blackjax.mcmc.diffusions as diffusions
2323
import blackjax.mcmc.mala as mala
24-
from tests.util import BlackJAXTest, std_normal_logdensity
24+
from tests.fixtures import BlackJAXTest, std_normal_logdensity
2525

2626
# ---------------------------------------------------------------------------
2727
# mcmc/diffusions.overdamped_langevin

tests/sgmcmc/test_diffusions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from absl.testing import absltest, parameterized
2121

2222
import blackjax.sgmcmc.diffusions as diffusions
23-
from tests.util import BlackJAXTest
23+
from tests.fixtures import BlackJAXTest
2424

2525

2626
class OverdampedLangevinTest(BlackJAXTest):

tests/sgmcmc/test_kernels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import blackjax.sgmcmc.sghmc as sghmc
2424
import blackjax.sgmcmc.sgld as sgld
2525
import blackjax.sgmcmc.sgnht as sgnht
26-
from tests.util import BlackJAXTest
26+
from tests.fixtures import BlackJAXTest
2727

2828
# ---------------------------------------------------------------------------
2929
# Shared helpers

tests/smc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import jax.scipy.stats as stats
33
import numpy as np
44

5-
from tests.util import BlackJAXTest
5+
from tests.fixtures import BlackJAXTest
66

77

88
class SMCLinearRegressionTestCase(BlackJAXTest):

tests/smc/test_from_mcmc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import blackjax.smc.resampling as resampling
2323
from blackjax.smc.base import SMCState, init
2424
from blackjax.smc.from_mcmc import build_kernel, unshared_parameters_and_step_fn
25-
from tests.util import BlackJAXTest, std_normal_logdensity
25+
from tests.fixtures import BlackJAXTest, std_normal_logdensity
2626

2727
# ---------------------------------------------------------------------------
2828
# unshared_parameters_and_step_fn

tests/smc/test_inner_kernel_tuning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
particles_means,
2525
particles_stds,
2626
)
27+
from tests.fixtures import BlackJAXTest
2728
from tests.mcmc.test_sampling import irmh_proposal_distribution
2829
from tests.smc import SMCLinearRegressionTestCase
29-
from tests.util import BlackJAXTest
3030

3131

3232
class MultivariableParticlesDistribution:

0 commit comments

Comments
 (0)