Skip to content

Commit 627dc62

Browse files
committed
Made cvxopt optional (#289)
1 parent 50645a8 commit 627dc62

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

poetry.lock

Lines changed: 3 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pypfopt/discrete_allocation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def lp_portfolio(self, reinvest=False, verbose=False, solver="GLPK_MI"):
320320

321321
opt = cp.Problem(cp.Minimize(objective), constraints)
322322

323-
if solver not in cp.installed_solvers():
323+
if solver is not None and solver not in cp.installed_solvers():
324324
raise NameError("Solver {} is not installed. ".format(solver))
325325
opt.solve(solver=solver)
326326

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ python = "^3.6.1"
3636
numpy = "^1.12"
3737
scipy = "^1.3"
3838
pandas = ">=0.19"
39-
cvxopt = "^1.2, !=1.2.5.post1"
4039
cvxpy = "^1.1.10"
41-
scikit-learn = {version="^0.24.1", optional= true }
42-
matplotlib = { version = "^3.2.0", optional = true }
40+
cvxopt = {version="^1.2, !=1.2.5.post1", optional=true }
41+
scikit-learn = {version = "^0.24.1", optional=true }
42+
matplotlib = { version = "^3.2.0", optional=true }
4343

4444
[tool.poetry.dev-dependencies]
4545
pytest = "^4.6"
@@ -51,7 +51,7 @@ jedi = "0.17.2"
5151
pytest-cov = "^2.11.1"
5252

5353
[tool.poetry.extras]
54-
optionals = ["scikit-learn", "matplotlib"]
54+
optionals = ["scikit-learn", "matplotlib", "cvxopt"]
5555

5656
[build-system]
5757
requires = ["poetry>=0.12"]

0 commit comments

Comments
 (0)