Skip to content

Commit f011857

Browse files
authored
Merge pull request #1966 from cmu-delphi/doctor_visit_clarabel
Weekday adjustment to use Clarabel instead of ECOS
2 parents 0c65bb4 + 74726ed commit f011857

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

_delphi_utils_python/delphi_utils/weekday.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _fit(X, scales, npnums, npdenoms):
9393
for scale in scales:
9494
try:
9595
prob = cp.Problem(cp.Minimize((-ll + lmbda * penalty) / scale))
96-
_ = prob.solve()
96+
_ = prob.solve(solver=cp.CLARABEL)
9797
return b.value
9898
except SolverError:
9999
# If the magnitude of the objective function is too large, an error is

_delphi_utils_python/tests/test_weekday.py

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,11 @@ def test_get_params(self):
1818

1919
result = Weekday.get_params(self.TEST_DATA, "den", ["num"], "date", [1], TEST_LOGGER)
2020
print(result)
21-
expected_result = [
22-
-0.05993665,
23-
-0.0727396,
24-
-0.05618517,
25-
0.0343405,
26-
0.12534997,
27-
0.04561813,
28-
-2.27669028,
29-
-1.89564374,
30-
-1.5695407,
31-
-1.29838116,
32-
-1.08216513,
33-
-0.92089259,
34-
-0.81456355,
35-
-0.76317802,
36-
-0.76673598,
37-
-0.82523745,
38-
]
21+
expected_result = np.array([[-0.05990542, -0.07272124, -0.05618539,
22+
0.0343087, 0.1253007, 0.04562494,
23+
-2.27662546, -1.8956484, -1.56959677,
24+
-1.29847058, -1.08226981, -0.92099449,
25+
-0.81464459, -0.76322013, -0.7667211,-0.8251475]])
3926
assert np.allclose(result, expected_result)
4027

4128
def test_calc_adjustment_with_zero_parameters(self):

0 commit comments

Comments
 (0)