Skip to content

Commit 7f57f60

Browse files
committed
refactor: according flake8
1 parent becc03a commit 7f57f60

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

okama/frontier/multi_period.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ def _max_cagr_asset(self) -> dict:
532532

533533
@property
534534
def _max_cagr_asset_right_to_max_cagr(self) -> Optional[dict]:
535+
# sourcery skip: use-named-expression
535536
"""
536537
The asset with max CAGR lying to the right of the global max CAGR point
537538
(risk should be more than self.max_return['Risk']).
@@ -540,7 +541,8 @@ def _max_cagr_asset_right_to_max_cagr(self) -> Optional[dict]:
540541
"""
541542
tolerance = 0.01 # assets CAGR should be less than max CAGR with certain tolerance
542543
cagr = helpers.Frame.get_cagr(self.assets_ror)
543-
if global_max_cagr_is_not_asset := (cagr < self.global_max_return_portfolio["CAGR"] * (1 - tolerance)).all():
544+
global_max_cagr_is_not_asset = (cagr < self.global_max_return_portfolio["CAGR"] * (1 - tolerance)).all()
545+
if global_max_cagr_is_not_asset:
544546
condition = self.risk_annual.values > self.global_max_return_portfolio["Risk"]
545547
ror_selected = self.assets_ror.loc[:, condition]
546548
if not ror_selected.empty:

0 commit comments

Comments
 (0)