Skip to content

Commit e729d75

Browse files
[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`
1 parent 65cabce commit e729d75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pypfopt/efficient_frontier/efficient_frontier.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def _validate_returns(self, returns):
142142
Helper method to validate daily returns (needed for some efficient frontiers)
143143
"""
144144
if not isinstance(returns, (pd.DataFrame, np.ndarray)):
145-
raise TypeError("returns should be a pd.Dataframe or np.ndarray")
145+
raise TypeError("returns should be a pd.DataFrame or np.ndarray")
146146

147147
returns_df = pd.DataFrame(returns)
148148
if returns_df.isnull().values.any():
@@ -163,10 +163,10 @@ def _validate_returns(self, returns):
163163
def _make_weight_sum_constraint(self, is_market_neutral):
164164
"""
165165
Helper method to make the weight sum constraint. If market neutral,
166-
validate the weights proided in the constructor.
166+
validate the weights provided in the constructor.
167167
"""
168168
if is_market_neutral:
169-
#  Check and fix bounds
169+
# Check and fix bounds
170170
portfolio_possible = np.any(self._lower_bounds < 0)
171171
if not portfolio_possible:
172172
warnings.warn(

0 commit comments

Comments
 (0)