DynamicRefLimits

Tuneable safety limits for dynamic-reference inference.

Usage

Source

DynamicRefLimits(
    max_branches=1024,
    max_cells=10000,
    max_depth=10,
)

Pass a custom instance via the limits parameter of DynamicRefConfig.from_constraints or DynamicRefConfig.from_constraints_and_workbook to override any of these defaults.

Parameter Attributes

max_branches: int = 1024
max_cells: int = 10000
max_depth: int = 10

Attributes

max_branches: int

Maximum number of discrete value assignments explored during constraint enumeration. This cap is applied in two places:

  • Per-dependency domain size - a single cell constrained to an integer interval wider than max_branches values cannot be enumerated; the caller must either tighten the constraint or rely on the symbolic (abstract) analysis path.
  • Cartesian-product size - when a formula cell falls back to brute-force evaluation over all combinations of its dependencies’ domains, the product of those domain sizes must not exceed max_branches. If it does, a DynamicRefError is raised immediately (rather than hanging) with a breakdown of which dependencies contributed to the explosion. Raise this limit or tighten the offending constraints to resolve the error.

Default: 1024.

max_cells: int

Maximum number of cells collected when expanding a range reference. Default: 10_000.

max_depth: int
Maximum AST-evaluation recursion depth. Default: 10.