Skip to content

Commit 2493c8f

Browse files
author
Lachlan Grose
committed
import osqp missing
1 parent c2fd2da commit 2493c8f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

LoopStructural/interpolators/discrete_interpolator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from LoopStructural.interpolators import GeologicalInterpolator
1414
from LoopStructural.utils import getLogger
15+
from LoopStructural.utils.exceptions import LoopImportError
1516

1617
logger = getLogger(__name__)
1718

@@ -474,8 +475,10 @@ def build_matrix(self, square=True, damp=0.0, ie=False):
474475
return ATA, ATB
475476
def _solve_osqp(self, P, A, q, l, u):
476477

477-
478-
# import osqp
478+
try:
479+
import osqp
480+
except ImportError:
481+
raise LoopImportError("Missing osqp pip install osqp")
479482
# m = A.shape[0]
480483
# n = A.shape[1]
481484
# Ad = sparse.random(m, n, density=0.7, format='csc')

0 commit comments

Comments
 (0)