-
Notifications
You must be signed in to change notification settings - Fork 86
Add _save_json unit test for profile model #952
Conversation
This PR needs Approvals as follows.
Please choose reviewers and requet reviews! Click to see how to approve each reviewsYou can approve this PR by triggered comments as follows.
See all trigger commentsPlease replace [Target] to review target
|
@Joeper214 Could you request a readability review after OA? |
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.
OA
@Joeper214 Thanks. It's always good to add suitable unit test case.
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.
Thank you for improving test coverage!
node_flops_dict=test_dict["flops"] | ||
) | ||
output_file = os.path.join(environment.EXPERIMENT_DIR, "{}_profile.json".format(test_dict["model_name"])) | ||
file_data = eval(open(output_file, 'r').read()) |
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.
eval
is a function that evaluates Python expressions. Please use json.load()
instead.
a1303ad
to
bd2328b
Compare
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.
Thank you!! Let me add 1 more comment!
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.
Readability Approval
Thank you!!
/ready |
⏳Merge job is queued... |
What this patch does to fix the issue.
This PR creates a unit test for
_save_json
method in profile_model.py to increase test code coverage.Link to any relevant issues or pull requests.
related to #692