fix flake8

pull/533/head
88d52bdba0366127fffca9dfa93895 2023-05-03 23:10:11 +07:00
parent 38d807e3bf
commit 94aa7cbf71
4 changed files with 9 additions and 8 deletions

View File

@ -1,3 +1,5 @@
[flake8]
max-line-length = 88
max-line-length = 120
extend-ignore = E203
per-file-ignores =
tests/test_imports.py:F401

View File

@ -591,10 +591,10 @@ def _get_all_args(expression: cp.Expression) -> List[cp.Expression]:
return list(_flatten([_get_all_args(arg) for arg in expression.args]))
def _flatten(l: Iterable) -> Iterable:
def _flatten(alist: Iterable) -> Iterable:
# Helper method to flatten an iterable
for el in l:
if isinstance(el, Iterable) and not isinstance(el, (str, bytes)):
yield from _flatten(el)
for v in alist:
if isinstance(v, Iterable) and not isinstance(v, (str, bytes)):
yield from _flatten(v)
else:
yield el
yield v

View File

@ -222,7 +222,7 @@ class CLA(base_optimizer.BaseOptimizer):
if (
self.w[i][j] - self.lB[j] < -tol
or self.w[i][j] - self.uB[j] > tol
): #  pragma: no cover
): # pragma: no cover
flag = True
break
if flag is True:

View File

@ -8,7 +8,6 @@ Currently implemented:
- ``plot_efficient_frontier`` plot the efficient frontier from an EfficientFrontier or CLA object
- ``plot_weights`` - bar chart of weights
"""
import copy
import warnings
import numpy as np