Skip to content
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

Log replay #215

Merged
merged 10 commits into from
Aug 16, 2024
Merged

Log replay #215

merged 10 commits into from
Aug 16, 2024

Conversation

KieranRatcliffeInvertedAI
Copy link
Contributor

Added tools to be able to conveniently read and write logs in the python SDK.

@KieranRatcliffeInvertedAI

This comment was marked as off-topic.

invertedai/logs/common.py Outdated Show resolved Hide resolved
invertedai/logs/common.py Outdated Show resolved Hide resolved
json.dump(output_dict, outfile)

@classmethod
def write_json_from_scenario_log(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be doing the same thing as write_scenario_log_to_json ? And it doesn't make any sense to pass a cls to an instance method. I am not sure if this will work without passing a concrete object to it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this and it indeed works. I can see it being useful if a user doesn't want to create a LogWriter object just to write the log to disk.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This module is called common but you are importing stuff from one level above. This might easily cause circular imports in the future and break the package level.
Also having docstrings for each method would be very helpful

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What name would you suggest? Perhaps logger.py, logging.py, logs.py, log_utils.py, anything else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add the docstrings for sure.

invertedai/logs/common.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Ruishenl Ruishenl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really have much further to add, i will let @rf-ivtdai to take another look

@KieranRatcliffeInvertedAI KieranRatcliffeInvertedAI merged commit 921961b into develop Aug 16, 2024
5 checks passed
@KieranRatcliffeInvertedAI KieranRatcliffeInvertedAI deleted the log_replay branch August 16, 2024 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants