Skip to content

Pass bounds to numerical derivatives for nonlinear constraints  #524

Open
@janosg

Description

@janosg

Background

The cyipopt version we used in testing caused an ImportError with the latest scipy versions; Therefore many of our tests for nonlinear constraints did not run.

Bug description

When trying to create the bounds for the numerical derivatives of nonlinear constraints, we use the user provided selector on the
user provided bounds. This does not work if bounds are just specified for a subset of a pytree.

Solution

The bounds that are passed to process_nonlinear_constraints already need to be extended to have the same structure as params. To avoid similar places in other problem, this extension should already be done in create_optimization_problem.

My temporary solution was to not pass bounds to the numerical derivatives of constraints which is usually not a big problem.

After fixing this, we need to comment the following code back in:

https://github.com/OpenSourceEconomics/optimagic/blob/a2fb0e554dae3ed5eda43191004ce9bbae267451/src/optimagic/parameters/nonlinear_constraints.py#L88

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions