Skip to content

Commit

Permalink
Automatically indent tune logger params (ray-project#3399)
Browse files Browse the repository at this point in the history
  • Loading branch information
hartikainen authored and ericl committed Nov 29, 2018
1 parent c46ea2f commit 7e319db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/ray/tune/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ class _JsonLogger(Logger):
def _init(self):
config_out = os.path.join(self.logdir, "params.json")
with open(config_out, "w") as f:
json.dump(self.config, f, sort_keys=True, cls=_SafeFallbackEncoder)
json.dump(
self.config,
f,
indent=2,
sort_keys=True,
cls=_SafeFallbackEncoder)
local_file = os.path.join(self.logdir, "result.json")
self.local_out = open(local_file, "w")

Expand Down

0 comments on commit 7e319db

Please sign in to comment.