Skip to content

convert everything to new mp.set_manager syntax #6

Description

@rdzman

The transition to the use of mp.set_manager to handle the fields of opt_model resulted in many methods of opt_model being deprecated. The use of these deprecated method calls needs to be removed from all MP-Opt-Model examples and tests, as well as from the MATPOWER and MOST distributions.

The deprecated methods and their new counterparts are ...

  • om.add_named_set() --> om.(sm).add()
  • om.describe_idx() --> om.(sm).describe_idx()
  • om.getN() --> om.(sm).get_N()
  • om.init_indexed_name() --> om.(sm).init_indexed_name()
  • om.add_lin_constraint() --> om.lin.add()
  • om.add_nln_constraint() --> om.nle.add(), om.nli.add()
  • om.add_nln_cost() --> om.nlc.add()
  • om.add_var() --> om.var.add()
  • om.eval_lin_constraint() --> om.lin.eval()
  • om.eval_nln_constraint_hess() --> om.nle.eval_hess(), om.nli.eval_hess
  • om.eval_nln_constraint() --> om.nle.eval(), om.nli.eval()
  • om.eval_nln_cost() --> om.nlc.eval()
  • om.eval_quad_cost() --> om.qdc.eval()
  • om.init_indexed_name() --> om.(sm).init_indexed_name()
  • om.params_lin_constraint() --> om.lin.params()
  • om.params_nln_constraint() --> om.nle.params(), om.nli.params()
  • om.params_nln_cost() --> om.nlc.params()
  • om.params_quad_cost() --> om.qdc.params()
  • om.params_var() --> om.var.params()
  • om.set_params() --> om.(sm).set_params()
  • om.varsets_cell2struct() --> mp.sm_variable.varsets_cell2struct()
  • om.varsets_idx() --> om.var.varsets_idx()
  • om.varsets_len() --> om.var.varsets_len()
  • om.varsets_x() --> om.var.varsets_x()

Activity

  1. rdzman commented on Jun 16, 2025

    @rdzman
    MemberAuthor

    It was decided that, rather than remove all uses of the deprecated methods in MP-Opt-Model, we would instead leave opt_model and its tests as-is for purposes of backward compatibility and instead, introduce mp.opt_model which supports only the new syntax. The documentation and examples in MP-Opt-Model have also been converted to use mp.opt_model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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