Skip to content

Commit

Permalink
Fix for reading inference back from HDF5
Browse files Browse the repository at this point in the history
  • Loading branch information
leonfoks committed Dec 13, 2023
1 parent e6b76e9 commit 531d05d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion geobipy/src/inversion/Inference1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,6 @@ def fromHdf(cls, hdfFile, index=None, fiducial=None):
s = s_[index, :]

self.nSystems = array(hdfFile.get('nsystems'))
self.acceptance_x = hdfRead.readKeyFromFile(hdfFile, '', '/', 'ratex')

key = 'iteration' if 'iteration' in hdfFile else 'i'
self.iteration = hdfRead.readKeyFromFile(hdfFile, '', '/', key, index=index)
Expand All @@ -1160,6 +1159,10 @@ def fromHdf(cls, hdfFile, index=None, fiducial=None):
key = 'acceptance_rate' if 'acceptance_rate' in hdfFile else 'rate'
self.acceptance_rate = hdfRead.readKeyFromFile(hdfFile, '', '/', key, index=s)

# Compute the x axis for acceptance since its every X iterations.
n = 2 * int32(self.n_markov_chains / self.update_plot_every)
self.acceptance_x = StatArray.StatArray(arange(1, n + 1) * self.update_plot_every, name='Iteration #')

self.best_datapoint = self.datapoint

self.data_misfit_v = hdfRead.readKeyFromFile(hdfFile, '', '/', 'phids', index=s)
Expand Down

0 comments on commit 531d05d

Please sign in to comment.