mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-07-19 19:00:58 +00:00
Eliminate extra empty lines in CSV monitor files on Windows (DLR-RM#692) (#695)
* Added ``newline="\n"`` when opening CSV monitor files so that each line ends with ``\r\n`` instead of ``\r\r\n`` on Windows while Linux environments are not affected
This commit is contained in:
parent
e24147390d
commit
222a69ca49
2 changed files with 3 additions and 2 deletions
|
|
@ -37,6 +37,7 @@ Others:
|
|||
^^^^^^^
|
||||
- Added a warning in the env checker when not using ``np.float32`` for continuous actions
|
||||
- Improved test coverage and error message when checking shape of observation
|
||||
- Added ``newline="\n"`` when opening CSV monitor files so that each line ends with ``\r\n`` instead of ``\r\r\n`` on Windows while Linux environments are not affected (@hsuehch)
|
||||
|
||||
Documentation:
|
||||
^^^^^^^^^^^^^^
|
||||
|
|
@ -852,4 +853,4 @@ And all the contributors:
|
|||
@ShangqunYu @PierreExeter @JacopoPan @ltbd78 @tom-doerr @Atlis @liusida @09tangriro @amy12xx @juancroldan
|
||||
@benblack769 @bstee615 @c-rizz @skandermoalla @MihaiAnca13 @davidblom603 @ayeright @cyprienc
|
||||
@wkirgsn @AechPro @CUN-bjy @batu @IljaAvadiev @timokau @kachayev @cleversonahum
|
||||
@eleurent @ac-93 @cove9988 @theDebugger811
|
||||
@eleurent @ac-93 @cove9988 @theDebugger811 @hsuehch
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ class ResultsWriter:
|
|||
filename = os.path.join(filename, Monitor.EXT)
|
||||
else:
|
||||
filename = filename + "." + Monitor.EXT
|
||||
self.file_handler = open(filename, "wt")
|
||||
self.file_handler = open(filename, "wt", newline="\n")
|
||||
self.file_handler.write("#%s\n" % json.dumps(header))
|
||||
self.logger = csv.DictWriter(self.file_handler, fieldnames=("r", "l", "t") + extra_keys)
|
||||
self.logger.writeheader()
|
||||
|
|
|
|||
Loading…
Reference in a new issue