Skip to content

Commit c2fd2da

Browse files
author
Lachlan Grose
committed
fix: commenting out osqp
1 parent 8197552 commit c2fd2da

File tree

3 files changed

+28
-27
lines changed

3 files changed

+28
-27
lines changed

LoopStructural/interpolators/discrete_interpolator.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -475,29 +475,29 @@ def build_matrix(self, square=True, damp=0.0, ie=False):
475475
def _solve_osqp(self, P, A, q, l, u):
476476

477477

478-
import osqp
479-
m = A.shape[0]
480-
n = A.shape[1]
481-
Ad = sparse.random(m, n, density=0.7, format='csc')
482-
b = np.random.randn(m)
483-
484-
# OSQP data
485-
P = sparse.block_diag([sparse.csc_matrix((n, n)), sparse.eye(m)], format='csc')
486-
q = np.zeros(n+m)
487-
A = sparse.vstack([
488-
sparse.hstack([Ad, -sparse.eye(m)]),
489-
sparse.hstack([sparse.eye(n), sparse.csc_matrix((n, m))])], format='csc')
490-
l = np.hstack([b, np.zeros(n)])
491-
u = np.hstack([b, np.ones(n)])
492-
493-
# Create an OSQP object
494-
prob = osqp.OSQP()
495-
496-
# Setup workspace
497-
prob.setup(P, q, A, l, u)
498-
499-
# Solve problem
500-
res = prob.solve()
478+
# import osqp
479+
# m = A.shape[0]
480+
# n = A.shape[1]
481+
# Ad = sparse.random(m, n, density=0.7, format='csc')
482+
# b = np.random.randn(m)
483+
484+
# # OSQP data
485+
# P = sparse.block_diag([sparse.csc_matrix((n, n)), sparse.eye(m)], format='csc')
486+
# q = np.zeros(n+m)
487+
# A = sparse.vstack([
488+
# sparse.hstack([Ad, -sparse.eye(m)]),
489+
# sparse.hstack([sparse.eye(n), sparse.csc_matrix((n, m))])], format='csc')
490+
# l = np.hstack([b, np.zeros(n)])
491+
# u = np.hstack([b, np.ones(n)])
492+
493+
# # Create an OSQP object
494+
# prob = osqp.OSQP()
495+
496+
# # Setup workspace
497+
# prob.setup(P, q, A, l, u)
498+
499+
# # Solve problem
500+
# res = prob.solve()
501501

502502

503503
# Create an OSQP object

LoopStructural/modelling/features/geological_feature.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import numpy as np
77

8-
from LoopStructural.utils import getLogger
8+
from LoopStructural.utils import getLogger, LoopValueError
99

1010
logger = getLogger(__name__)
1111

@@ -134,6 +134,8 @@ def evaluate_value(self, evaluation_points):
134134
numpy array containing evaluated values
135135
136136
"""
137+
if evaluation_points.shape[1] != 3:
138+
raise LoopValueError("Need Nx3 array of xyz points to evaluate value")
137139
# TODO need to add a generic type checker for all methods
138140
# if evaluation_points is not a numpy array try and convert
139141
# otherwise error
@@ -171,6 +173,8 @@ def evaluate_gradient(self, evaluation_points):
171173
-------
172174
173175
"""
176+
if evaluation_points.shape[1] != 3:
177+
raise LoopValueError("Need Nx3 array of xyz points to evaluate gradient")
174178
self.builder.up_to_date()
175179
v = np.zeros(evaluation_points.shape)
176180
v[:] = np.nan

LoopStructural/modelling/features/geological_feature_builder.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
"""
22
Feature builder
33
"""
4-
import copy
5-
import logging
6-
74
import numpy as np
85
import pandas as pd
96

0 commit comments

Comments
 (0)