-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/add json logger #46
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great Ruan pretty much entirely just docstring changes.
The big thing to clarify is evaluation_step
, we want to make it clear that it's not the number of evaluation timesteps.
marl_eval/json_tools/json_logger.py
Outdated
environment_name: str, | ||
seed: int, | ||
): | ||
"""Initialises the JsonWriter and creates the file if it doesn't exist.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Initialises the JsonWriter and creates the file if it doesn't exist.""" | |
"""Initialises the JsonLogger and create the file if it doesn't exist.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrote it slightly differently to your suggestion.
self.run_data[step_str] = step_metrics | ||
|
||
with open(self.file_path, "w") as f: | ||
json.dump(self.data, f, indent=4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we reduced the indent to 2 here it would save quite a lot of space 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. We've just used 4 as a default in the past.
Co-authored-by: Sasha <reallysasha@gmail.com>
Co-authored-by: Sasha <reallysasha@gmail.com>
Co-authored-by: Sasha <reallysasha@gmail.com>
Co-authored-by: Sasha <reallysasha@gmail.com>
Co-authored-by: Sasha <reallysasha@gmail.com>
Co-authored-by: Sasha <reallysasha@gmail.com>
Co-authored-by: Sasha <reallysasha@gmail.com>
Co-authored-by: Sasha <reallysasha@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny thing, but approving anyways, feel free to make this change and then merge (changing indent level is up to you) 😄
Co-authored-by: Sasha <reallysasha@gmail.com>
What?
Add a json logger to marl-eval to enable easy logging according to the protocol in the correct json format.