Skip to content

Update Egor wrapper to egobox 0.38 - #498

Merged
ewu63 merged 5 commits into
mdolab:mainfrom
relf:update-wrapper-0.38
Oct 8, 2026
Merged

ewu63 merged 5 commits into
mdolab:mainfrom
relf:update-wrapper-0.38

Conversation

@relf

@relf relf commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Purpose

Update the Egor wrapper to egobox 0.38, which deprecates several Python API names. The wrapper now uses only non-deprecated APIs and passes pyOptSparse constraint bounds natively to Egor.

Egor has not been in a pyOptSparse release yet, so options are renamed without backward-compatibility aliases.

Changes

  • Dependency: egobox>=0.38.0,<0.39.0 (pyproject.toml, .github/environment.yml).
  • Native constraint specs: constraints are no longer converted to the one-sided c(x) <= 0 form. Each pyOptSparse constraint row is mapped from its bounds to an Egor CstrSpec (eq, leq, geq or between) and Egor gets the raw constraint values.
  • Renamed options to follow egobox 0.38:
    • n_start → infill_n_start
    • doe → x_doe / y_doe
    • cstr_tol → cstr_tols, with one tolerance per pyOptSparse constraint row (no longer per one-sided constraint)
  • New options:
    • feasible_infill_strategy (EFI for hidden constraints, not available with LOG_EI)
    • stop_on_error
  • New inform: 7, objective function error.
  • Docs: Egor_options.yaml updated for the new options and for the 0.38 dict keys (trego.n_global_local_steps, gp_config.theta_n_start, qei_config.optim_every, ...).

Expected time until merged

This is a follow-up of #485, so hopefully, next week.

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

  • Existing Egor tests (test_egor, test_hs015, test_hs071, test_sphere) updated to the new names.
  • New tests:
    • initial DOE with x_doe and with x_doe + y_doe
    • feasible_infill_strategy
    • cstr_tols length mismatch
    • equality + double-sided constraints with an active bound
  • pytest -k "Egor or egor" -W error::DeprecationWarning passes (13 tests) with egobox 0.38.0.

Checklist

  • I have run ruff check and ruff format to make sure the Python code adheres to PEP-8 and is consistently formatted
  • I have formatted the Fortran code with fprettify or C/C++ code with clang-format as applicable
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.22%. Comparing base (d68de76) to head (ea16774).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #498   +/-   ##
=======================================
  Coverage   54.22%   54.22%           
=======================================
  Files           1        1           
  Lines         225      225           
=======================================
  Hits          122      122           
  Misses        103      103           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@relf
relf marked this pull request as ready for review October 1, 2026 20:52
@relf
relf requested review from a team, ewu63 and marcomangano as code owners October 1, 2026 20:52
@relf
relf requested review from ArshSaja and sabakhshi October 1, 2026 20:52
@marcomangano

Copy link
Copy Markdown
Collaborator

@relf the test failures are due to the fact that egobox 0.38 is not available on Conda yet. Do you have a timeline for it?

Otherwise this looks good. We should expedite the merge of the last sets of PRs from @ewu63 and make a new minor release soon!

@relf

relf commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor Author

@marcomangano, @ewu63, egobox 0.38 is now available on Conda. Please re-run the failed jobs, they should pass now.

Comment thread pyproject.toml
testing = [
"testflo>=1.4.5",
"parameterized",
"egobox>=0.37.6,<0.38.0",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we anticipate breaking changes such that we need a very tight pin here @relf ? Since this is only testing deps I am OK with it, but in general I'd prefer catching upstream changes early in these tests rather than have our users find out when they run optimizations, so my preference would be to not pin.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the API should be stable, I intend to release 1.0, removing 0.38 deprecations, so if it is ok for you I can relax the upper bound to <2 even in the project.toml

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me

@relf relf Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally, after a good night’s sleep, I don’t see the point of having an upper bound anymore. What do you think?

@ewu63
ewu63 merged commit f8d344c into mdolab:main Oct 8, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants