Skip to content

Commit 6dac458

Browse files
Copilotnjzjz
andcommitted
fix(quip/gap/xyz): remove linebreak between configurations in multi-system export
Co-authored-by: njzjz <[email protected]>
1 parent 3e19545 commit 6dac458

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

dpdata/plugins/xyz.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,9 @@ def to_labeled_system(self, data, file_name: FileType, **kwargs):
8080
content = "\n".join(frames)
8181

8282
if isinstance(file_name, io.IOBase):
83-
# When writing to a file handler, check if file is empty
84-
# If not empty, add a newline separator before content
85-
current_pos = file_name.tell()
86-
if current_pos > 0:
87-
file_name.write("\n")
8883
file_name.write(content)
84+
if not content.endswith("\n"):
85+
file_name.write("\n")
8986
else:
9087
with open_file(file_name, "w") as fp:
9188
fp.write(content)

0 commit comments

Comments
 (0)