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

Update flake8 and fixed lint #923

Merged
merged 2 commits into from
Mar 18, 2020
Merged

Conversation

kchygoe
Copy link
Member

@kchygoe kchygoe commented Mar 13, 2020

  • updated flake8 package
  • fixed the lint along with new flake8 rules

What this patch does to fix the issue.

Link to any relevant issues or pull requests.

@blueoil-butler blueoil-butler bot added the CI: auto-run Run CI automatically label Mar 13, 2020
@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

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

@kchygoe kchygoe requested a review from iizukak March 13, 2020 11:51
@@ -171,7 +171,7 @@ def _image_ids(self, data_type=None):
return all_image_ids

image_ids = [
image_id for image_id, gt_boxes in zip(all_image_ids, all_gt_boxes_list) if len(gt_boxes) is not 0
image_id for image_id, gt_boxes in zip(all_image_ids, all_gt_boxes_list) if len(gt_boxes) != 0
Copy link
Member

Choose a reason for hiding this comment

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

is not is not allowed by newer flake8?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, errors F632 use ==/!= to compare str, bytes, and int literals are appeared

Copy link
Member

Choose a reason for hiding this comment

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

I see.

Copy link
Contributor

Choose a reason for hiding this comment

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

is compares identity (whether two reference points to the same object). == compares values.
there's no point using is when comparing int values.

@kchygoe kchygoe self-assigned this Mar 16, 2020
@kchygoe kchygoe requested a review from tfujiwar March 16, 2020 03:09
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 the code quality!
I left some small comments.

return []


def _column_name(event_accumulator, metrics_key):
return "{}:{}".format(os.path.basename(event_accumulator.path), metrics_key)


def output(tensorboard_dir, output_dir, metrics_keys, steps, output_file_base="metrics"):
def output(
tensorboard_dir, output_dir, metrics_keys, steps, output_file_base="metrics"
Copy link
Contributor

@tfujiwar tfujiwar Mar 16, 2020

Choose a reason for hiding this comment

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

Could you fix the indentation to distinguish the arguments and the contents of the function?

def output(
        tensorboard_dir, output_dir, metrics_keys, steps, output_file_base="metrics"):

or something like this.

def output(tensorboard_dir, output_dir, metrics_keys,
           steps, output_file_base="metrics"):

Copy link
Member Author

Choose a reason for hiding this comment

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

sorry these was formatted by the formatter I mis-configured. thank you!

Comment on lines 112 to 114
""".format(
output_csv, output_md
)
Copy link
Contributor

Choose a reason for hiding this comment

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

You can write this in a single line.

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

@kchygoe kchygoe requested a review from tfujiwar March 17, 2020 17:25
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 (reverse-shadowing)

@kchygoe kchygoe requested a review from tsawada March 18, 2020 01:31
Copy link
Contributor

@tsawada tsawada 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

@@ -171,7 +171,7 @@ def _image_ids(self, data_type=None):
return all_image_ids

image_ids = [
image_id for image_id, gt_boxes in zip(all_image_ids, all_gt_boxes_list) if len(gt_boxes) is not 0
image_id for image_id, gt_boxes in zip(all_image_ids, all_gt_boxes_list) if len(gt_boxes) != 0
Copy link
Contributor

Choose a reason for hiding this comment

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

is compares identity (whether two reference points to the same object). == compares values.
there's no point using is when comparing int values.

@kchygoe
Copy link
Member Author

kchygoe commented Mar 18, 2020

/ready

@bo-mergebot
Copy link
Contributor

bo-mergebot bot commented Mar 18, 2020

⏳Merge job is queued...

@bo-mergebot bo-mergebot bot merged commit 4f7bba6 into blue-oil:master Mar 18, 2020
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.

4 participants