Skip to content

Discussion: Should MOI.set perform complex operations? #358

@joaquimg

Description

@joaquimg

As far as I understand MOI.set is primarily used for setting attributes.

However, #356 introduced:
function MOI.set(model::Model, ::DiffOpt.ForwardDifferentiate)
as a replacement to
function forward_differentiate!(model)

Historically, performing more complex operations has been left (mostly?) for special functions such as:

  • compute_conflict!
  • write_to_file
  • read_from_file
  • submit
  • transform

A partial counter argument is:

  • Utilities.PenaltyRelaxation, but it is a modify not even a set
    I do think modify here makes sense.

Are there any other arguments to each side? any other precedent?

I would like to have the reasoning for that clarified.

What are de advantages and disadvantages?

Bonus:
As a follow-up, we should have good practices and standards documented to help developers consistently make decisions in these cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions