Targets¶
Target functional contracts for update-support problems.
- exception updatesupport.targets.UnsupportedTargetError[source]¶
Bases:
TypeErrorRaised when a target functional is outside the supported contract.
- class updatesupport.targets.TargetCapabilities(supports_adequacy, supports_interval, supports_fiber_decomposition, supports_exact_lower=False, supports_exact_upper=False, supports_conservative_interval=False)[source]¶
Bases:
objectCapability flags for target-level operations.
- Parameters:
- class updatesupport.targets.TargetContract(kind, name, formula, description, fixed_after_compilation, supports_adequacy, supports_interval, supports_fiber_decomposition, limitations=(), supports_exact_lower=None, supports_exact_upper=None, supports_conservative_interval=None)[source]¶
Bases:
objectHuman- and machine-readable contract for a target functional.
- Parameters:
- property capabilities: TargetCapabilities¶
- class updatesupport.targets.UnsupportedTarget(name, kind, formula, description='', reason='This target functional is not supported by the current fixed linear target backend.', limitations=())[source]¶
Bases:
objectExplicit marker for target functionals not yet supported by core solvers.
- Parameters:
- reason: str = 'This target functional is not supported by the current fixed linear target backend.'¶
- property contract: TargetContract¶
- class updatesupport.targets.ProcedureTargetContext(data, public, hidden, weight=None, min_cell_weight=1.0, q='saturated', q_radius=None)[source]¶
Bases:
objectContext supplied when compiling a representation-dependent target.
A procedure target is compiled by tabular workflows before a finite
FiniteProblemis constructed. The compiler should return a column name or row metric for the supplied public representation.- Parameters:
- class updatesupport.targets.ProcedureTarget(name, compiler, description='', formula='public representation -> compiled target values -> reported aggregate', limitations=())[source]¶
Bases:
objectRepresentation-dependent target compiled by tabular workflows.
compilerreceives aProcedureTargetContextand must return the actual column name or row metric to use for that representation. The compiled target is then treated as a fixed hidden-cell target by the finite solver.- Parameters:
- compiler: Callable[[ProcedureTargetContext], Any]¶
- property contract: TargetContract¶
- compile(context)[source]¶
Return the column name or row metric for
context.- Parameters:
context (ProcedureTargetContext)
- Return type:
- class updatesupport.targets.LinearTarget(values, name='linear_target', description='fixed linear plug-in target', source=None)[source]¶
Bases:
objectFixed linear plug-in target
psi(q) = sum_d h(d) q(d).- property contract: TargetContract¶
- class updatesupport.targets.UncertainLinearTarget(values, standard_errors, name='uncertain_linear_target', description='fixed linear target with estimator standard errors', confidence_multiplier=1.96, source=None)[source]¶
Bases:
objectFixed linear plug-in target with hidden-cell estimator standard errors.
- Parameters:
- property contract: TargetContract¶
- class updatesupport.targets.MomentTransformTarget(moments, transform, name='moment_transform', description='fixed transform of linear moments', affine_coefficients=None, intercept=0.0, curvature='unknown', monotonicity=(), cvxpy_transform=None, capabilities=None, formula=None, source=None, limitations=())[source]¶
Bases:
objectFixed transform of one or more linear moments.
The mathematical form is
psi(q) = g(mu(q))where each moment ismu_j(q) = sum_d m_j(d) q(d). Affine transforms reduce to fixed linear hidden-cell targets. Convex or concave transforms can expose one exact CVXPY endpoint, and monotone transforms can expose conservative interval bounds from separately optimized moment boxes.- Parameters:
- capabilities: TargetCapabilities | None = None¶
- property resolved_capabilities: TargetCapabilities¶
- property contract: TargetContract¶
- class updatesupport.targets.RatioTarget(numerator, denominator, name='ratio_target', description='fixed linear-fractional ratio target', source=None)[source]¶
Bases:
objectFixed ratio target
psi(q) = <n,q> / <w,q>.The denominator must be strictly positive on every retained state. General constrained-Q ratio support is intentionally narrow; saturated public-fiber environments solve ratio intervals exactly, standard CVXPY can solve local fixed-public-law ratio intervals through DQCP, and linear backends can use a ratio target when the denominator is constant over the state space.
- Parameters:
- property contract: TargetContract¶
- updatesupport.targets.coerce_linear_target(states, value, *, name='linear_target', description='fixed linear plug-in target', source=None)[source]¶
Coerce mappings, sequences, callables, or LinearTarget objects.
- Parameters:
- Return type:
- updatesupport.targets.coerce_target(states, value, *, name='linear_target', description='fixed linear plug-in target', source=None)[source]¶
Coerce a supported target functional.
- Parameters:
- Return type:
LinearTarget | UncertainLinearTarget | MomentTransformTarget | RatioTarget
- updatesupport.targets.raise_if_unsupported_target(value, *, context)[source]¶
Raise when
valuedeclares a non-linear or unsupported target contract.
- updatesupport.targets.declared_target_contract(value)[source]¶
Return a declared target contract from marker/future target objects.
- Parameters:
value (Any)
- Return type:
TargetContract | None