Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Pylint Error Fixes #14851

Closed
stu1130 opened this issue May 1, 2019 · 9 comments
Closed

Pylint Error Fixes #14851

stu1130 opened this issue May 1, 2019 · 9 comments

Comments

@stu1130
Copy link
Contributor

stu1130 commented May 1, 2019

MXNet currently use very old version of pylint. Here we capture several pieces of code that need to be fixed/ refactored.

no-else-raise
1.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/contrib/onnx/mx2onnx/_export_helper.py#L43
2.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/contrib/onnx/onnx2mx/_translation_utils.py#L181
3.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/contrib/text/vocab.py#L213
4.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/gluon/trainer.py#L252
5.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/gluon/trainer.py#L266
6.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/gluon/utils.py#L343
7.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/image/detection.py#L812
8.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/image/image.py#L1377
9.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/model.py#L643
10.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/ndarray/sparse.py#L642
11.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/ndarray/sparse.py#L1105
12.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/test_utils.py#L209
13.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/test_utils.py#L1351
14.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/test_utils.py#L1378
15.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/test_utils.py#L1458
unbalanced-tuple-unpacking
1.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/contrib/quantization.py#L64
2.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/rnn/rnn_cell.py#L519
3.
https://github.com/apache/incubator-mxnet/blob/bde1b8498f217dc9ca0adfe99db7c24c1eaa8fea/python/mxnet/rnn/rnn_cell.py#L1423

@mxnet-label-bot
Copy link
Contributor

Hey, this is the MXNet Label Bot.
Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it.
Here are my recommended labels: Bug

@stu1130
Copy link
Contributor Author

stu1130 commented May 2, 2019

@mxnet-label-bot add [Call for Contribution]

@cchung100m
Copy link
Contributor

Hi @stu1130 ,

I'm interested in working on this if no one else has signed up. I propose to remove the 'else' statement after the 'raise' statment for solving the 'no-else-raise' situation. However, I am not sure on dealing with 'unbalanced-tuple-unpacking' situation, I would appreciate if you can give me some references or suggestions.

Many thanks,

@stu1130
Copy link
Contributor Author

stu1130 commented May 27, 2019

@cchung100m Thanks. I'll need to take a look at those functions that have 'unbalanced-tuple-unpacking' warning once I have time. You could first deal with 'raise' & 'no-else-raise'

@ChaiBapchya
Copy link
Contributor

Looks like the above 2 types of errors/warnings have been taken care of with @cchung100m PR

One thing is yet to be addressed
assignment-from-no-return error

Error log from make pylint

************* Module mxnet.image.detection
E:215, 8: Assigning to function call which doesn't return (assignment-from-no-return)
E:216, 8: Assigning to function call which doesn't return (assignment-from-no-return)
E:222, 8: Assigning to function call which doesn't return (assignment-from-no-return)
E:223, 8: Assigning to function call which doesn't return (assignment-from-no-return)
E:224, 8: Assigning to function call which doesn't return (assignment-from-no-return)
E:225, 8: Assigning to function call which doesn't return (assignment-from-no-return)
E:263, 8: Assigning to function call which doesn't return (assignment-from-no-return)
E:264, 8: Assigning to function call which doesn't return (assignment-from-no-return)
E:266, 8: Assigning to function call which doesn't return (assignment-from-no-return)
E:267, 8: Assigning to function call which doesn't return (assignment-from-no-return)
E:926,20: Assigning to function call which doesn't return (assignment-from-no-return)
************* Module mxnet.test_utils
E:575, 4: Assigning to function call which doesn't return (assignment-from-no-return)
E:600, 4: Assigning to function call which doesn't return (assignment-from-no-return)

@ChaiBapchya
Copy link
Contributor

@stu1130 Do you think this is a good-first-contribution worthy issue?

@stu1130
Copy link
Contributor Author

stu1130 commented Aug 7, 2019

@ChaiBapchya yeah

@stu1130
Copy link
Contributor Author

stu1130 commented Aug 7, 2019

@mxnet-label-bot add [Good First Issue]

@dheeraj-coding
Copy link

I was looking into this issue and it this error doesn't seem to be there in the current master.
Current Error log from make pylint

************* Module compare_layers
C0411: third party import "import mxnet as mx" should be placed before "import cv2" (wrong-import-order)
************* Module convert_caffe_modelzoo
C0411: third party import "import mxnet as mx" should be placed before "from convert_model import convert_model" (wrong-import-order)
************* Module convert_model
C0411: third party import "import mxnet as mx" should be placed before "import caffe_parser" (wrong-import-order)

@szha szha closed this as completed Jul 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants