Skip to content

Commit 266828c

Browse files
committed
Test compatibility with 2.35
1 parent f5cd77d commit 266828c

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242
name: tests
4343
runs-on: ${{ matrix.os }}
4444
strategy:
45-
fail-fast: false
4645
matrix:
4746
os: [ubuntu-latest, macos-latest, windows-latest]
4847
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

test/test_sample.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -646,19 +646,29 @@ def test_sample_no_params() -> None:
646646
stan = os.path.join(DATAFILES_PATH, 'datagen_poisson_glm.stan')
647647
datagen_model = CmdStanModel(stan_file=stan)
648648
datagen_fit = datagen_model.sample(iter_sampling=100, show_progress=False)
649-
assert np.isnan(datagen_fit.step_size).all()
650649
summary = datagen_fit.summary()
651-
assert 'lp__' in list(summary.index)
650+
651+
if cmdstan_version_before(2, 36):
652+
assert 'lp__' not in list(summary.index)
653+
assert datagen_fit.step_size is None
654+
else:
655+
assert 'lp__' in list(summary.index)
656+
assert np.isnan(datagen_fit.step_size).all()
652657

653658
exe_only = os.path.join(DATAFILES_PATH, 'exe_only')
654659
shutil.copyfile(datagen_model.exe_file, exe_only)
655660
os.chmod(exe_only, 0o755)
656661
datagen2_model = CmdStanModel(exe_file=exe_only)
657662
datagen2_fit = datagen2_model.sample(iter_sampling=200, show_console=True)
658663
assert datagen2_fit.chains == 4
659-
assert np.isnan(datagen2_fit.step_size).all()
660664
summary = datagen2_fit.summary()
661-
assert 'lp__' in list(summary.index)
665+
666+
if cmdstan_version_before(2, 36):
667+
assert datagen2_fit.step_size is None
668+
assert 'lp__' not in list(summary.index)
669+
else:
670+
assert np.isnan(datagen2_fit.step_size).all()
671+
assert 'lp__' in list(summary.index)
662672

663673

664674
def test_index_bounds_error() -> None:

0 commit comments

Comments
 (0)