Skip to content

Commit

Permalink
fix nasty data slicing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
svandenhaute committed Jul 20, 2024
1 parent b603af7 commit fdf2739
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions psiflow/data/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def _write_frames(
else: # single geometry
all_states.append(extra_states)
with open(outputs[0], "w") as f:
for state in all_states:
f.write(state.to_string() + "\n")
for state in all_states: # avoid double newline by using strip!
f.write(state.to_string().strip() + '\n')


write_frames = python_app(_write_frames, executors=["default_threads"])
Expand Down Expand Up @@ -77,7 +77,8 @@ def _read_frames(

if len(outputs) > 0:
with open(outputs[0], "w") as f:
f.write("\n".join([d for d in data if d is not None]))
f.write("\n".join([d.strip() for d in data if d is not None]))
f.write("\n")
else:
geometries = [Geometry.from_string(s) for s in data if s is not None]
return geometries
Expand Down

0 comments on commit fdf2739

Please sign in to comment.