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

Elastic sub problem and fixes #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

harrysalmon
Copy link

@harrysalmon harrysalmon commented Oct 31, 2023

New contribution elastically_constrain

Pulp contains the concept of an "elastic sub problem" or "elastic constraint" which is actually better thought of as a symmetric penalty around a value, with an optional penalty free zone.

This PR introduces this concept into the LP array following the design pattern of the existing constrain.

Fixes

  • np.object was deprecated in numpy==0.20 and now fails in numpy==0.25 np.object deprecated #3
  • Error in README example Error in README example #4
  • typo in the test "MaxOnePerDust"
  • Docstring in abs_decompose updated to better reflect what the method is doing (hopefully)

This updates the readme to use the example in the test. And corrects two things:

- Reduce the number of argument and use keyword arguments in `create_anon`.
- `from pulp_lparray import lparray`
While working with the function I found the docstring
misleading.

If I've understood it correctly:
- |self| looks like the modulus or determinant, shuld be just self
- The arrays difference rather than sum to self
- the key equality is missed from the list of properties
This commt adds the support within Pulp-LParrays to "constrain" with an
elastic sub problem following the same symantics as the hard constraints.
Fix deprecated support, update readme and add elastic subproblem
@harrysalmon
Copy link
Author

Thank you for the fantastic extension to PuLP

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.

1 participant