- Notifications
You must be signed in to change notification settings - Fork64
Flake8 code style fixes#241
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
0d9164c to04d50ceCompare
9prady9 left a 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.
Most of utility abstractions look good although it seems majority of if checks are now contradicting PEP8 style in the following two patterns:
if <var> is None:orif <var> is not Noneshould be preferred overif <var>:per PEP8 guidline -https://www.python.org/dev/peps/pep-0008/#programming-recommendationsif <var> == 0 or <some number>- not sure what's PEP8 stance on this type of comparisons, but numerical comparisons are better written this way to ensure better code readability and understanding instead ofif <var>:which seems like checking for None and may lead to confusion.
Uh oh!
There was an error while loading.Please reload this page.
16f3c01 to9b328f1Compareroaffix commentedNov 13, 2020
You are right. Some variables are considered to be |
9b328f1 toad77595CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| location=Source.device | ||
| else: | ||
| location=Source.host | ||
| location=Source.deviceifis_deviceelseSource.host |
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.
revert
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.
IMO, it's better now :)
| high_arr=constant_array(high,vdims[0],vdims[1],vdims[2],vdims[3],vty) | ||
| else: | ||
| high_arr=high.arr | ||
| low_arr=low.arrifis_low_arrayelseconstant_array(low,vdims[0],vdims[1],vdims[2],vdims[3],vty) |
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.
revert
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.
Still, I don't see a point to revert these changes. These variables are just temp variables and they are not changed later anyhow. But we drop extra 7 lines of code.
ad77595 to6012303CompareUh oh!
There was an error while loading.Please reload this page.
6012303 to28a0f61Comparec20136f to911be16Compare911be16 tob7cffa1Compareroaffix commentedNov 14, 2020
I'm going to postpone this PR till#244 is merged. I will add the arg |
to_strmethod to library from utils to avoid import errors