Skip to content

Commit

Permalink
Merge branch 'master' into termination
Browse files Browse the repository at this point in the history
  • Loading branch information
williamjameshandley committed Mar 4, 2024
2 parents c662252 + 3ea992c commit 5ef5cd9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion anesthetic/read/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def read_chains(root, *args, **kwargs):
Parameters
----------
root : str
root : str, pathlib.Path
root name for reading files
*args, **kwargs:
Expand All @@ -39,6 +39,7 @@ def read_chains(root, *args, **kwargs):
:class:`anesthetic.samples.MCMCSamples` depending on auto-detection
"""
root = str(root)
if 'burn_in' in kwargs:
raise KeyError(
"This is anesthetic 1.0 syntax. The `burn_in` keyword is no "
Expand Down
7 changes: 7 additions & 0 deletions tests/test_reader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import anesthetic.examples._matplotlib_agg # noqa: F401
import os
from pathlib import Path
import pytest
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
Expand Down Expand Up @@ -300,3 +301,9 @@ def test_hdf5(tmp_path, root):
samples_ = read_hdf(filename, key)
assert_frame_equal(samples_, samples)
assert type(samples_) is type(samples)


@pytest.mark.parametrize('root', ['pc', 'gd'])
def test_path(root):
base_dir = Path("./tests/example_data")
read_chains(base_dir / root)

0 comments on commit 5ef5cd9

Please sign in to comment.