Hi Jeremy,
Thanks for your reply. I am having difficulty following step 2. In restart_writer, there is a line
restart = segment.data.pop('iterh5/restart', None)
How do I properly load the segment object? I have tried without loading the segment object:
import h5py
import westpa
from io import BytesIO
from westpa.core.h5io import safe_extract
import tarfile
iseg=0
n_iter=1
iter_h5_filepath = "traj_segs/iter_"+str(int(n_iter)).zfill(6)+".h5"
data = h5py.File(iter_h5_filepath)['restart/'+str(n_iter)+'_'+str(iseg)+'/data']
d = BytesIO(data[()][:-1])
with tarfile.open(fileobj=d, mode='r:gz') as t:
safe_extract(t, path='traj_segs/'+str(int(n_iter)).zfill(6))
But this gives an error:
EOFError: Compressed file ended before the end-of-stream marker was reached
I have also tried generating a segment object by importing from westpa
from westpa.core.segment import Segment
segment = Segment
segment.n_iter=n_iter
segment.seg_id=iseg
segment.data['iterh5/restart'] = d.getvalue() + b'\x01'
But this results in an error:
AttributeError: type object 'Segment' has no attribute 'data'
How do I properly load the segment object with data?
Thanks,
Hayden