Skip to content

[Utillities] refactor operate, operate!, operate_term, operate_terms, operate_output_index! - #2208

Merged
odow merged 13 commits into
masterfrom
od/operate
Jun 20, 2023
Merged

odow merged 13 commits into
masterfrom
od/operate

Conversation

@odow

@odow odow commented Jun 19, 2023

Copy link
Copy Markdown
Member

Part of #2203

Still need to work on a bunch of methods

@odow odow changed the title WIP: refactor Utilities.operate [Utillities] refactor operate, operate!, operate_term, operate_terms, operate_output_index! Jun 20, 2023
@odow
odow requested a review from blegat June 20, 2023 04:15
@odow

odow commented Jun 20, 2023

Copy link
Copy Markdown
Member Author

@blegat I've now moved all of the Utilities.operate_xxx methods into operate.jl with documentation and tests. I found quite a few missing methods and quirks, but things are in a nice state now.

There are only two operate methods left in functions.jl, which are for ScalarNonlinearFunction. I'll leave them for now, and come back in a new PR with the new methods.

We should also revisit the diversity of names. I think operate_coefficient could be deprecated in favor of operate_term.

And we can potentially remove some methods in favor of the methods in mutable_arithmetics.jl.

But they're all smaller changes for a new PR.

@blegat

blegat commented Jun 20, 2023 •

Copy link
Copy Markdown
Member

We should also revisit the diversity of names. I think operate_coefficient could be deprecated in favor of operate_term.

We can't really deprecate before MOI v2

And we can potentially remove some methods in favor of the methods in mutable_arithmetics.jl.

Yes, the only advantage of operate is the easy dispatch since we know T but it was developed before MA so MA could replace most of it

@odow

odow commented Jun 20, 2023

Copy link
Copy Markdown
Member Author

We can't really deprecate before MOI v2

Yeah. But we can forward the methods and add a note to the docstring.

@odow

odow commented Jun 20, 2023

Copy link
Copy Markdown
Member Author

Merging because this is a bit hard to review, but it's a clear improvement to the code base.

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