Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Add _save_json unit test for profile model #952

Merged
merged 4 commits into from
Mar 31, 2020

Conversation

Joeper214
Copy link
Contributor

@Joeper214 Joeper214 commented Mar 27, 2020

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

@blueoil-butler blueoil-butler bot added the CI: auto-run Run CI automatically label Mar 27, 2020
@Joeper214 Joeper214 self-assigned this Mar 27, 2020
@Joeper214 Joeper214 requested review from iizukak and tfujiwar and removed request for iizukak and tfujiwar March 27, 2020 09:21
@Joeper214 Joeper214 marked this pull request as ready for review March 30, 2020 01:22
@bo-code-review-bot
Copy link

This PR needs Approvals as follows.

  • Ownership Approval for / from iizukak, tkng, ruimashita
  • Readability Approval for Python from tkng, tsawada, tfujiwar

Please choose reviewers and requet reviews!

Click to see how to approve each reviews

You can approve this PR by triggered comments as follows.

  • Approve all reviews requested to you (readability and ownership) and LGTM review
    Approval, LGTM

  • Approve all ownership reviews
    Ownership Approval or OA

  • Approve all readability reviews
    Readability Approval or RA

  • Approve specified review targets

    • Example of Ownership Reviewer of /: Ownership Approval for / or OA for /
    • Example of Readability Reviewer of Python: Readability Approval for Python or RA for Python
  • Approve LGTM review
    LGTM

See all trigger comments

Please replace [Target] to review target

  • Ownership Approval
    • Ownership Approval for [Target]
    • OA for [Target]
    • Ownership Approval
    • OA
    • Approval
  • Readability Approval
    • Readability Approval for [Target]
    • RA for [Target]
    • [Target] Readability Approval
    • [Target] RA
    • Readability Approval
    • RA
    • Approval
  • LGTM
    • LGTM
    • lgtm

@Joeper214 Joeper214 requested review from iizukak and tfujiwar and removed request for iizukak March 30, 2020 01:22
@tfujiwar
Copy link
Contributor

@Joeper214 Could you request a readability review after OA?

@Joeper214 Joeper214 requested review from iizukak and removed request for tfujiwar March 30, 2020 01:55
Copy link
Member

@iizukak iizukak left a 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.

@Joeper214 Joeper214 requested a review from tfujiwar March 31, 2020 01:39
Copy link
Contributor

@tfujiwar tfujiwar left a 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())
Copy link
Contributor

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.

Copy link
Contributor

@tfujiwar tfujiwar left a 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!

@Joeper214 Joeper214 requested a review from tfujiwar March 31, 2020 06:33
Copy link
Contributor

@tfujiwar tfujiwar left a 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!!

@Joeper214
Copy link
Contributor Author

/ready

@bo-mergebot
Copy link
Contributor

bo-mergebot bot commented Mar 31, 2020

⏳Merge job is queued...

@bo-mergebot bo-mergebot bot merged commit 67323b3 into blue-oil:master Mar 31, 2020
oatawa1 pushed a commit to oatawa1/blueoil that referenced this pull request Mar 31, 2020
oatawa1 pushed a commit to oatawa1/blueoil that referenced this pull request Mar 31, 2020
@Joeper214 Joeper214 deleted the add_unit_test branch April 1, 2020 03:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI: auto-run Run CI automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants