You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generally, nesting more than a few for-loops is considered bad practice in Python because it is known to imply that a) there might be a more efficient way of doing it (for example, through itertools), or if not a), then that b) the code is probably difficult to read.
Because Pylint is now enforcing a max line length of 90 in the codebase, it has become more relevant to reduce line length. To make lines less long on average, generally you would do something like this:
for a in ax:
for b in bx:
for c in cx:
for d in dx:
// do something in d
// do something in c
// do something in b
// do something in a
would become
for a in ax:
for b in bx:
loop_over_c()
// do something in b
// do something in a
loop_over_c(){
for c in cx:
for d in dx:
// do something in d
// do something in c
}
We should consider looking for places in the code where this sort of change could be applied, such as in capacity_factor.py.
The text was updated successfully, but these errors were encountered:
Generally, nesting more than a few for-loops is considered bad practice in Python because it is known to imply that a) there might be a more efficient way of doing it (for example, through itertools), or if not a), then that b) the code is probably difficult to read.
Because Pylint is now enforcing a max line length of 90 in the codebase, it has become more relevant to reduce line length. To make lines less long on average, generally you would do something like this:
would become
We should consider looking for places in the code where this sort of change could be applied, such as in capacity_factor.py.
The text was updated successfully, but these errors were encountered: