Skip to content
Snippets Groups Projects
Commit 20383996 authored by Matthew Pitkin's avatar Matthew Pitkin
Browse files

emcee.py: run black

parent 50a26043
No related branches found
No related tags found
No related merge requests found
......@@ -332,15 +332,18 @@ class Emcee(MCMCSampler):
def write_chains_to_file(self, sample):
chain_file = self.checkpoint_info.chain_file
temp_chain_file = chain_file + '.temp'
temp_chain_file = chain_file + ".temp"
if self.prerelease:
points = np.hstack([sample.coords, sample.blobs])
else:
points = np.hstack([sample[0], np.array(sample[3])])
data_to_write = "\n".join(self.checkpoint_info.chain_template.format(ii, *point) for ii, point in enumerate(points))
data_to_write = "\n".join(
self.checkpoint_info.chain_template.format(ii, *point)
for ii, point in enumerate(points)
)
with open(temp_chain_file, "w") as ff:
ff.write(data_to_write)
with open(temp_chain_file, 'rb') as ftemp, open(chain_file, 'ab') as fchain:
with open(temp_chain_file, "rb") as ftemp, open(chain_file, "ab") as fchain:
shutil.copyfileobj(ftemp, fchain)
os.remove(temp_chain_file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment