alternative

Start Here

  • Quickstart
    • Register Implementations
    • Test the Contract
    • Benchmark Representative Inputs
    • Choose a Default
    • Use Methods
    • Next Steps
  • An Optimization Workflow
    • Reference and Candidate
    • Startup Imports
    • Test the Contract and Measure the Result

Guides

  • Example applications
    • NumPy optimisation
      • Compare with Alternative
    • Evolving Quantum Circuits
      • Test, Score, and Benchmark the Finalists
  • Pytest Integration
    • Equivalence Tests
    • Check Expected Results
    • Benchmark All Implementations
    • Only the Default Implementation
    • Testing Methods
    • Async Tests
    • Reference Caching
    • Collection Order
  • Testing Observable Behavior
    • Fresh Inputs for Mutating Functions
    • Exceptions Are Part of the Contract
    • Numerical Comparisons
    • Different but Valid Outputs
  • Runtime Workflow
    • When to Use It
    • Selection Lifecycle
    • Measure Implementations
    • Safety Rules
    • Debug Mode
    • Registration Forms
    • Copying Implementations
    • Typed Calls
  • Methods and Descriptors
    • Decorator Order
    • Imported Static Candidates
    • Call Through a Class or Instance
    • Testing and Measuring
  • Performance and When to Use It
    • A Rough Overhead Budget
    • Benchmark Your Application
    • Measure Dispatch in Your Environment

Reference and Development

  • API Reference
    • Decorator
      • reference()
    • Alternatives
      • Alternatives
      • Alternatives.add()
      • Alternatives.pytest_parametrize()
      • Alternatives.pytest_parametrize_pairs()
    • Implementation
      • Implementation
      • Implementation.add()
    • Exceptions
      • AlternativeError
      • AddTooLateError
      • MultipleDefaultsError
      • CrossAlternativesImplementationError
    • Typing and IDEs
  • Contributing and Releases
    • Validation
    • Typing Compatibility Checks
    • Publishing
alternative
  • Index

Index

_ | A | C | I | M | P | R

_

  • __call__() (alternative.Alternatives method)
    • (alternative.Implementation method)

A

  • add() (alternative.Alternatives method)
    • (alternative.Implementation method)
  • AddTooLateError
  • alternative
    • module
  • AlternativeError
  • Alternatives (class in alternative)

C

  • callable (alternative.Alternatives property)
  • CrossAlternativesImplementationError

I

  • Implementation (class in alternative)
  • implementations (alternative.Alternatives property)

M

  • measure() (alternative.Alternatives method)
  • module
    • alternative
  • MultipleDefaultsError

P

  • pytest_parametrize() (alternative.Alternatives method)
  • pytest_parametrize_pairs() (alternative.Alternatives method)

R

  • reference (alternative.Alternatives property)
  • reference() (in module alternative)

© Copyright 2025, Oliver Bristow.

Built with Sphinx using a theme provided by Read the Docs.