Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass bounds to numerical derivatives for nonlinear constraints #524

Open
janosg opened this issue Aug 20, 2024 · 0 comments
Open

Pass bounds to numerical derivatives for nonlinear constraints #524

janosg opened this issue Aug 20, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@janosg
Copy link
Member

janosg commented Aug 20, 2024

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

@janosg janosg added the bug Something isn't working label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants