Repository navigation
Let tao_pounders use TAO's default convergence test. - #739
Merged
Merged
Conversation
… annotations. With `from __future__ import annotations`, dataclass field types are annotation strings rather than type objects, so the TYPE_CONVERTERS lookup in Algorithm.__post_init__ never matched and option coercion/validation was silently skipped for all optimizer modules using the import. Adds a string-keyed TYPE_CONVERTERS_BY_NAME lookup so coercion works identically with and without the import, plus regression tests: a dummy algorithm defined under postponed annotations mirroring the existing type conversion tests, and a registry-wide test that passes floats for all int-typed options of every algorithm. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Brings in #696, which replaces the hand-written option converter table with pydantic validation. PR #691, whose fix for the same problem was the first commit on this branch, was closed in favor of #696, so its changes are dropped here rather than merged: - src/optimagic/type_conversion.py: deleted (superseded by validated_dataclass in optimagic/typing.py), including the TYPE_CONVERTERS_BY_NAME lookup #691 added. - Algorithm.__post_init__: removed, main validates via mark.minimizer instead. - tests/.../test_algorithm_future_annotations.py: deleted. Its coverage of the postponed-annotations path is provided by main's test_algo_option_validation_stringified.py, and its registry-wide int coercion test by test_all_algorithms_can_be_instantiated_with_defaults. Docs conflicts resolved by keeping this branch's docstrings on top of main's widened annotations: - Fides.hessian_update_strategy is now HessianUpdateStrategy, not a bare Literal, so its docstring no longer claims that HessianApproximation instances are unavailable; it explains that Broyden must be passed as an instance because phi has no default. - PygmoMbh.inner_algorithm uses the PygmoAlgorithm alias. Also documents the new constraint that field annotations must be resolvable at runtime in how_to_document_optimizers.md, since pydantic now resolves them and a TYPE_CHECKING-only name in a field type raises on instantiation. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removes CLEANUP_NOTES.MD, CONSTRAINTS_REFACTOR_REVIEW.md and REPORT.md, which were committed by accident, and fixes "libray" and "simple have a look" in how_to_add_optimizers.ipynb. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/source/refs.bib
Every example in algorithms.md now passes params as a NumPy array, drops the `...` placeholders and is self-contained, so each code block runs as is. Bounds are added for all algorithms that need them, and least-squares and likelihood examples mark their functions accordingly. This also fixes examples that used options that don't exist (bayes_opt `n_iter`, pyswarms `topology_type` and `k_neighbors`), a syntax error in the iminuit example, a shgo example that crashed without bounds, and a nag_pybobyqa string-interface example whose option was silently dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since mark.minimizer re-creates algorithm classes as pydantic dataclasses that inherit from the original class, autodoc treated all documented fields as inherited and did not show them. Every autoclass directive in algorithms.md now uses `:inherited-members: Algorithm, object`, as the gfo and pyswarms entries already did, and the how-to guide explains why. The guide's quote of the ScipyLBFGSB docstring is synced with the corrected docstring. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sources. Every class and field docstring was checked against the optimagic wrapper code and the upstream sources (scipy 1.17.1, NLopt 2.10.1, pagmo2, Ipopt 3.14 / cyipopt 1.6.1, DFO-LS 1.6.2, Py-BOBYQA 1.5.0, fides 0.7.4, tranquilo 0.1.1). Wrong formulas, defaults, option semantics and references are corrected, undocumented deviations from upstream defaults are stated, and where the wrapper behaves unexpectedly the docstrings describe the actual behavior. The stale module-level constant docstrings in nag_optimizers.py, which contradicted the class docs, are removed. Typos in a few error and warning messages are fixed; no logic changes. refs.bib gets corrected author fields and titles and a new entry for the Ipopt negative curvature test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/source/how_to/how_to_add_optimizers.ipynb
# Conflicts: # docs/source/algorithms.md # src/optimagic/optimizers/nlopt_optimizers.py
The custom convergence test for stopping_maxiter replaced TAO's default test, so the convergence_gtol_* criteria had no effect. The iteration limit is now set with setMaximumIterations, and the dead custom tests are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
janosg
commented
Nov 15, 2026
janosg
left a comment
Member
Author
There was a problem hiding this comment.
Good to merge from my side.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #690.
tao_poundersalways installed a custom convergence test forstopping_maxiter, which replaced TAO's default test. As a result,convergence_gtol_abs,convergence_gtol_relandconvergence_gtol_scaledhad no effect. The iteration limit is now set withsetMaximumIterations, and TAO's default test checks all criteria. Reachingstopping_maxiteris now reported as unsuccessful ("maxits reached") instead of "user defined".The old tests accepted "step size small" as an outcome, so they could not catch this. They are replaced by one test per stopping criterion.
🤖 Generated with Claude Code