Skip to content

Commit

Permalink
Fix backend filename if the user changes the h5 filename (#185)
Browse files Browse the repository at this point in the history
* fix backend filename

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Dacheng Xu <[email protected]>
  • Loading branch information
3 people authored Sep 4, 2024
1 parent a70de8d commit 2854878
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions appletree/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ def from_backend(cls, backend_h5_file_name):
nwalkers = file["mcmc"].attrs["nwalkers"]
batch_size = file["mcmc"].attrs["batch_size"]
tree = cls(instruct)
# Overwrite the backend_h5 file name. If the user renames the
# backend file then it could be different from the one in intruct
tree.backend_h5 = backend_h5_file_name
tree.pre_fitting(nwalkers, batch_size=batch_size)
return tree

Expand Down

0 comments on commit 2854878

Please sign in to comment.