From e729d75a50121625ff2e774ad2b7066737587d6d Mon Sep 17 00:00:00 2001 From: Robert Martin <11792905+robertmartin8@users.noreply.github.com> Date: Sun, 16 Nov 2025 07:50:47 -0500 Subject: [PATCH] [ENH] Fix typos in `efficient_frontier` (#635) ## Summary - fix typo in _validate_returns: DataFrame - fix typo in _make_weight_sum_constraint: provided - normalize whitespace in weight sum check comment ## Testing - `flake8` --- pypfopt/efficient_frontier/efficient_frontier.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pypfopt/efficient_frontier/efficient_frontier.py b/pypfopt/efficient_frontier/efficient_frontier.py index bec2fe0d..b428dcc5 100644 --- a/pypfopt/efficient_frontier/efficient_frontier.py +++ b/pypfopt/efficient_frontier/efficient_frontier.py @@ -142,7 +142,7 @@ def _validate_returns(self, returns): Helper method to validate daily returns (needed for some efficient frontiers) """ if not isinstance(returns, (pd.DataFrame, np.ndarray)): - raise TypeError("returns should be a pd.Dataframe or np.ndarray") + raise TypeError("returns should be a pd.DataFrame or np.ndarray") returns_df = pd.DataFrame(returns) if returns_df.isnull().values.any(): @@ -163,10 +163,10 @@ def _validate_returns(self, returns): def _make_weight_sum_constraint(self, is_market_neutral): """ Helper method to make the weight sum constraint. If market neutral, - validate the weights proided in the constructor. + validate the weights provided in the constructor. """ if is_market_neutral: - #  Check and fix bounds + # Check and fix bounds portfolio_possible = np.any(self._lower_bounds < 0) if not portfolio_possible: warnings.warn(