Skip to content

Conversation

@dalyw
Copy link
Contributor

@dalyw dalyw commented Jan 2, 2026

Updating error to note that absolute_value not valid for cvxpy, as neither is DCP-compliant

Allowing binary_big_M for cvxpy with gurobi

Addresses #45 and #46

Pull request recommendations:

  • Name your pull request your-development-type/short-description. Ex: feature/gui
  • Link to any relevant issue in the PR description. Ex: Resolves [ENH: Support optimization of flexibility metrics #12]
  • Provide context of changes.
  • Provide relevant tests for your feature or bug fix.
  • Provide or update documentation for any feature added by your pull request.

Thanks for contributing!

Updating error to note that  absolute_value not valid for cvxpy, as neither is DCP-compliant

Allowing binary_big_M for cvxpy with gurobi
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.48%. Comparing base (63ef646) to head (d275197).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
+ Coverage   93.40%   93.48%   +0.07%     
==========================================
  Files          10       10              
  Lines        1593     1626      +33     
==========================================
+ Hits         1488     1520      +32     
- Misses        105      106       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@fletchapin fletchapin left a comment

Choose a reason for hiding this comment

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

Looks great to me! @arao53 might have comments since he's more familiar with MILP

.. code-block:: python
from electric_emission_cost import costs
from eeco import costs
Copy link
Contributor

Choose a reason for hiding this comment

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

good catch!

- "absolute_value": Uses max(x, 0) constraints. Creates nonlinear problem
for Pyomo due to abs() constraint.
- "binary_big_M": Uses binary indicator with Big-M constraints.
Creates a MILP (mixed-integer linear program) for Pyomo.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be "for Pyomo or CVXPY" since binary_big_M is supported for both?

- "absolute_value": Uses max(x, 0) constraints. Creates nonlinear problem
for Pyomo due to abs() constraint.
- "binary_big_M": Uses binary indicator with Big-M constraints.
Creates a MILP (mixed-integer linear program) for Pyomo.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be "for Pyomo or CVXPY" since binary_big_M is supported for both?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants