Skip to content

Accept typed callables as scalar objectives - #111

Merged
isty2e merged 3 commits into
mainfrom
feat/callable-objective-ingress
Jul 28, 2026
Merged

Accept typed callables as scalar objectives#111
isty2e merged 3 commits into
mainfrom
feat/callable-objective-ingress

Conversation

@isty2e

@isty2e isty2e commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

Problem now accepts a typed scalar callable through objective= and normalizes it at construction into the existing Objective and evaluation-protocol path.

This keeps callable convenience at the public boundary without adding another execution model. Direction handling, failure recording, evaluation accounting, diagnostics, and the direct scalar sequential fast path continue to use the established contracts. Callable-backed problems also retain stable equality and hashing when they wrap the same callable object.

The README, quickstart, evaluator guide, and changelog now show the shorter callable form and explain the portability boundary. Importable module-level functions remain the conservative choice when evaluation may cross process or MPI boundaries.

Validation

  • uv run ruff check --extend-select I,UP pyproject.toml src tests .github/scripts
  • uv run ruff format --check pyproject.toml src tests .github/scripts
  • uv run --extra test pre-commit run --all-files
  • uv run basedpyright
  • uv run pytest (1702 passed)
  • uv run mkdocs build --strict

Closes #96

@isty2e
isty2e merged commit a5355dd into main Jul 28, 2026
8 checks passed
@isty2e
isty2e deleted the feat/callable-objective-ingress branch July 28, 2026 14:43
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.

Add a callable adapter for simple scalar objectives

1 participant