Skip to content

Public guidance for solver wrappers converting maxiters #1242

Description

@mmikhasenko

Downstream solver wrappers may want to translate the common maxiters keyword into a backend-specific call limit.

Minuit2.jl previously used the internal helper Optimization._check_and_convert_maxiters(maxiters). With Optimization 5.2.0 this helper is no longer defined, so downstream code that relied on it fails before reaching the solver.

Compact reproduction:

julia> using Optimization

julia> pkgversion(Optimization)
v"5.2.0"

julia> isdefined(Optimization, :_check_and_convert_maxiters)
false

julia> Optimization._check_and_convert_maxiters(nothing)
ERROR: UndefVarError: `_check_and_convert_maxiters` not defined in `Optimization`

In Minuit2.jl this caused the Optimization extension to fail during solve(...) before calling Minuit. We can avoid the breakage locally by converting nothing/non-negative numeric maxiters to the backend's ncall keyword ourselves, but it would be helpful to know whether Optimization.jl intends solver wrappers to:

  • implement this conversion locally;
  • use a public replacement helper; or
  • avoid this conversion entirely and pass raw common keywords through another API.

If there is a preferred public API for this in Optimization 5.x, a pointer would be enough.

Activity

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