Closed roaffix closed 3 years ago
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.
You are right. Some variables are considered to be None
by default, so it should be checked. Nice catch! I'll fix that.
In other cases, some of your checks, e.g., AF_PATH
in library.py
check if AF_PATH is None
, but it should fail if AF_PATH == ""
. Simple conditions change to if AF_PATH
can fix such problems when the default value or variable type is not known.
I'm going to postpone this PR till #244 is merged. I will add the arg --flake8
to the pytest for automatic code style checks here right after.
to_str
method to library from utils to avoid import errors