Skip to content

Capacity change algorithm rewrite, closes #192#193

Merged
bmeyers merged 22 commits into
mainfrom
cap_fix
Mar 28, 2025
Merged

Capacity change algorithm rewrite, closes #192#193
bmeyers merged 22 commits into
mainfrom
cap_fix

Conversation

@bmeyers

@bmeyers bmeyers commented Mar 25, 2025

Copy link
Copy Markdown
Collaborator

Closes #192

This PR addresses the bug that was uncovered where the capacity change algorithm returns incorrect results on some test data when using the default solver. This is a rewrite of the signal decomposition implementation, such that the exact some problem is now being solved by clarabel and mosek.

Checklist for PR authors (skip items if you don't have permissions or they are not applicable)

  • Updated or added relevant tests
  • Updated relevant documentation
  • Added relevant label(s)
  • All comments are resolved

Comment thread solardatatools/signal_decompositions.py Outdated
solver=solver,
verbose=verbose,
)
if solver is not None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this isn't going in the _cvx_signal_decompositions module to follow the others in this module? (by this, I mean the decomposition logic)

Comment thread solardatatools/signal_decompositions.py Outdated
verbose=verbose,
)
if solver is not None:
if solver.upper() not in ["MOSEK", "CLARABEL", "OSQP"]:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we alert the user here that CLARABEL is being used if, for example, QSS was passed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove OSQP as well

return test_r, train_r, best_ix, jmp_counts, min_jumps

def plot_weight_optimization(self):
_fig, _ax = plt.subplots(nrows=3, sharex=True, figsize=(10, 5))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add docstring

@bmeyers

bmeyers commented Mar 28, 2025

Copy link
Copy Markdown
Collaborator Author

@pluflou all checks are passing again, so I think we're ready for the final review

@bmeyers bmeyers merged commit bd83fcd into main Mar 28, 2025
@bmeyers bmeyers deleted the cap_fix branch March 28, 2025 23:30
cocosrv pushed a commit to cocosrv/solar-data-tools that referenced this pull request Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Capacity change algorithm provides incorrect answer under certain circumstances

2 participants