Skip to content

Commit

Permalink
specify lineterminator in writing datafiles
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorb1 committed Oct 22, 2023
1 parent c21fe2a commit 2f3df18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/otoole/write_strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _write_parameter(
df = self._form_parameter(df, default)
handle.write("param default {} : {} :=\n".format(default, parameter_name))
df.to_csv(
path_or_buf=handle, sep=" ", header=False, index=True, float_format="%g"
path_or_buf=handle, sep=" ", header=False, index=True, float_format="%g", lineterminator="\n"
)
handle.write(";\n")

Expand All @@ -171,7 +171,7 @@ def _write_set(self, df: pd.DataFrame, set_name, handle: TextIO):
"""
handle.write("set {} :=\n".format(set_name))
df.to_csv(
path_or_buf=handle, sep=" ", header=False, index=False, float_format="%g"
path_or_buf=handle, sep=" ", header=False, index=False, float_format="%g", lineterminator="\n"
)
handle.write(";\n")

Expand Down

0 comments on commit 2f3df18

Please sign in to comment.