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

[Utilities] ignore attributes in UniversalFallback if set to nothing #2575

Merged
merged 5 commits into from
Nov 5, 2024

Conversation

odow
Copy link
Member

@odow odow commented Nov 1, 2024

x-ref jump-dev/Gurobi.jl#584

We don't have a way to remove attributes once they've been set. We've mostly settled on nothing as the resetting to default.

For example

If the attribute `attr` is set for the variable `v` in the model `model`, return
its value, return `nothing` otherwise. If the attribute `attr` is not supported
by `model` then an error should be thrown instead of returning `nothing`.

An optimizer attribute for setting a time limit (in seconds) for an
optimization. When `set` to `nothing`, it deactivates the solver time limit. The
default value is `nothing`.

The provided limit must be a `Union{Real,Nothing}`.
When `set` to `nothing`, the limit reverts to the solver's default.

@odow
Copy link
Member Author

odow commented Nov 2, 2024

This needs some tests

@odow
Copy link
Member Author

odow commented Nov 3, 2024

@odow
Copy link
Member Author

odow commented Nov 4, 2024

solver-tests.yml shows no issues.

@blegat
Copy link
Member

blegat commented Nov 5, 2024

Another approach would be to simply delete it from the dictionary when it's set to nothing

@odow odow merged commit c389e3a into master Nov 5, 2024
16 checks passed
@odow odow deleted the od/unset-attribute branch November 5, 2024 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants