Expose full qpOASES Configuration options; add docs, type stubs, and pyright cleanliness - #4
Merged
Merged
Conversation
Extend the C++ `Configuration` struct and pybind11 bindings to expose every qpOASES `Options` field (35 options) plus the wrapper-specific fields, so the full qpOASES API is reachable from Python. Apply them all through a single `_to_qpoases_options()` helper. - `include/qpOASES_solver.h`: full, doxygen-documented `Configuration` with double-precision defaults; scoped `using` directives inside `namespace M3` (preserves the MSVC/`SparseMatrix` fix from #2). - `src/core_function.cpp`: map all options; use `std::vector` instead of a VLA for `xOpt` (preserves the MSVC fix from #2). - `src/core.cpp`: bind all new fields; expose `PrintLevel`, `SubjectToStatus`, and the full `HessianType` enum sets. Documentation & typing: - `README.md`: rewritten with quickstart, configuration reference (defaults + per-option tables), building-from-source, and type-checking notes. - `AGENTS.md`: added with build/test/lint commands and behavioural invariants. - `marinholab/solvers/qpoases/_core.pyi` + `py.typed`: type stub so the package is checkable by Pyright; `setup.py` ships both in the wheel. - `solver.py`, `__init__.py`, `example.py`, `example_kinematics.py`: added type annotations; `pyrightconfig.json` (py3.9, basic) makes `pyright` pass with 0 errors / 0 warnings. Behaviour is preserved: `enableRegularisation`/`enableNZCTests`/ `enableFlippingBounds` keep their fast/MPC defaults and `print_level` now defaults to `PL_LOW` (quiet) while remaining configurable. Co-authored-by: openhands <openhands@all-hands.dev>
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.
This PR was created by an AI agent (OpenHands) on behalf of @mmmarinho.
Summary
Extends the Python/C++ wrapper so
Configurationexposes the full qpOASESOptionsAPI (all 35 options), keeps prior solver behaviour, and adds Doxygen-style documentation plus complete Python type annotations.What changed
include/qpOASES_solver.h—Configurationnow carries every qpOASESOptionsfield (1:1, double-precision defaults), plus the wrapper-specificmaximum_working_set_recalculations,use_hotstart, andhessian_type. Each member is documented Doxygen-style.src/core_function.cpp— a single_to_qpoases_options()helper maps the wholeConfigurationonto qpOASESOptionsand is applied on thesolve_quadratic_programpath.src/core.cpp— pybind11 bindings for all new fields, and the fullHessianType,PrintLevel,SubjectToStatus, andBooleanTypeenum sets.Documentation & typing
README.md— rewritten: quickstart, a full configuration reference (per-option tables with defaults), building from source, and type-checking notes.AGENTS.md— new: build/test/lint commands and the behavioural invariants to preserve.marinholab/solvers/qpoases/_core.pyi+py.typed— a type stub so the package is checkable by Pyright/Pylance;setup.pyships both in the wheel.solver.py,__init__.py,example.py,example_kinematics.py— added type annotations;pyrightconfig.json(Python 3.9, basic mode) makespyrightpass with 0 errors / 0 warnings.Behaviour preserved
enableRegularisation,enableNZCTests,enableFlippingBoundskeep their fast/MPCBT_FALSEdefaults (the wrapper's historical effective behaviour);enableRegularisationin particular was corrected toBT_FALSErather than qpOASES'BT_TRUEso the semi-definite/indefinite examples keep working.print_levelnow defaults toPL_LOW(quiet, as before) and is genuinely honoured — setting it toPL_HIGH/PL_MEDIUMmakes qpOASES print its iteration trace.Verified
_coreplus the.pyistub andpy.typedmarker are all present in the installed package.qpoases_exampleruns (positive-definite, semi-definite,None-constraints, active-set paths) with no changes to prior results.print_level=PL_HIGHproduces qpOASES output,PL_LOWstays quiet; tolerance/Hessian options flow through to the solver.pyrightclean on the source tree and against the installed package (reveal_typeresolvesfloat/HessianType/PrintLeveletc.).Note (pre-existing, not caused by this change)
The locally built wheel reports a version derived from git history (
setuptools-git-versioning), which differs from the tagged version in a shallow clone. This is unrelated to the option-exposure change and is left untouched.