- 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
to04d50ce
CompareThere 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 None
should 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
to9b328f1
Compare
You are right. Some variables are considered to be |
9b328f1
toad77595
CompareUh 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.device if is_device else Source.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.arr if is_low_array else constant_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
to6012303
CompareUh oh!
There was an error while loading.Please reload this page.
6012303
to28a0f61
Comparec20136f
to911be16
Compare911be16
tob7cffa1
CompareI'm going to postpone this PR till#244 is merged. I will add the arg |
to_str
method to library from utils to avoid import errors