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

Add Utilities.sorted_list_of_model_attributes #2371

Closed
wants to merge 3 commits into from

Conversation

odow
Copy link
Member

@odow odow commented Dec 20, 2023

src/Utilities/copy.jl Outdated Show resolved Hide resolved
@odow odow force-pushed the od/SortedListOfModelAttributesSet branch from 0931bd8 to 82dacaa Compare December 20, 2023 23:22
@odow
Copy link
Member Author

odow commented Dec 21, 2023

Looking into why Juniper started to fail tests

@odow
Copy link
Member Author

odow commented Dec 21, 2023

So this issue is that Juniper defines a bunch of model filters:
https://github.com/lanl-ansi/Juniper.jl/blob/05ae25efee510ef6d4cbe90bb098460ec728a8f3/src/filter.jl#L1-L29
and we can't define a new AbstractModelAttribute like this without breaking existing behavior.

@odow odow changed the title Add Utilities.SortedListOfModelAttributesSet Add Utilities.sorted_list_of_model_attributes Dec 21, 2023
@@ -9,9 +9,39 @@

include("copy/index_map.jl")

_sort_priority(::Any) = 2
_sort_priority(::MOI.UserDefinedFunction) = 0
_sort_priority(::MOI.ObjectiveSense) = 1
Copy link
Member Author

@odow odow Dec 21, 2023

Choose a reason for hiding this comment

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

So in retrospect, all this PR really needed was _sort_priority(::Any) = 3 and _sort_priority(::MOI.ObjectiveFunction) = 2.

Do we want to make this all public?

Copy link
Member

Choose a reason for hiding this comment

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

I would do this simple fix, and reopen this PR if this keeps coming back and someone actually needs to extend this kind of methods.

@odow
Copy link
Member Author

odow commented Dec 21, 2023

@odow
Copy link
Member Author

odow commented Dec 21, 2023

Closing in favor of #2372

@odow odow closed this Dec 21, 2023
@odow odow deleted the od/SortedListOfModelAttributesSet branch December 21, 2023 07:52
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.

Order of model attributes during copy
2 participants