Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weekday adjustment to use Clarabel instead of ECOS #1966

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _delphi_utils_python/delphi_utils/weekday.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _fit(X, scales, npnums, npdenoms):
for scale in scales:
try:
prob = cp.Problem(cp.Minimize((-ll + lmbda * penalty) / scale))
_ = prob.solve()
_ = prob.solve(solver=cp.CLARABEL)
return b.value
except SolverError:
# If the magnitude of the objective function is too large, an error is
Expand Down
23 changes: 5 additions & 18 deletions _delphi_utils_python/tests/test_weekday.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,11 @@ def test_get_params(self):

result = Weekday.get_params(self.TEST_DATA, "den", ["num"], "date", [1], TEST_LOGGER)
print(result)
expected_result = [
-0.05993665,
-0.0727396,
-0.05618517,
0.0343405,
0.12534997,
0.04561813,
-2.27669028,
-1.89564374,
-1.5695407,
-1.29838116,
-1.08216513,
-0.92089259,
-0.81456355,
-0.76317802,
-0.76673598,
-0.82523745,
]
expected_result = np.array([[-0.05990542, -0.07272124, -0.05618539,
0.0343087, 0.1253007, 0.04562494,
-2.27662546, -1.8956484, -1.56959677,
-1.29847058, -1.08226981, -0.92099449,
-0.81464459, -0.76322013, -0.7667211,-0.8251475]])
assert np.allclose(result, expected_result)

def test_calc_adjustment_with_zero_parameters(self):
Expand Down
Loading