Skip to content

Commit 94aa7cb

Browse files
author
88d52bdba0366127fffca9dfa93895
committed
fix flake8
1 parent 38d807e commit 94aa7cb

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

.flake8

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
[flake8]
2-
max-line-length = 88
2+
max-line-length = 120
33
extend-ignore = E203
4+
per-file-ignores =
5+
tests/test_imports.py:F401

pypfopt/base_optimizer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -591,10 +591,10 @@ def _get_all_args(expression: cp.Expression) -> List[cp.Expression]:
591591
return list(_flatten([_get_all_args(arg) for arg in expression.args]))
592592

593593

594-
def _flatten(l: Iterable) -> Iterable:
594+
def _flatten(alist: Iterable) -> Iterable:
595595
# Helper method to flatten an iterable
596-
for el in l:
597-
if isinstance(el, Iterable) and not isinstance(el, (str, bytes)):
598-
yield from _flatten(el)
596+
for v in alist:
597+
if isinstance(v, Iterable) and not isinstance(v, (str, bytes)):
598+
yield from _flatten(v)
599599
else:
600-
yield el
600+
yield v

pypfopt/cla.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def _purge_num_err(self, tol):
222222
if (
223223
self.w[i][j] - self.lB[j] < -tol
224224
or self.w[i][j] - self.uB[j] > tol
225-
): #  pragma: no cover
225+
): # pragma: no cover
226226
flag = True
227227
break
228228
if flag is True:

pypfopt/plotting.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
- ``plot_efficient_frontier`` – plot the efficient frontier from an EfficientFrontier or CLA object
99
- ``plot_weights`` - bar chart of weights
1010
"""
11-
import copy
1211
import warnings
1312

1413
import numpy as np

0 commit comments

Comments
 (0)