soleil.overrides.overrides#
Module Attributes
An override specification -- Various possibilities: |
Functions
|
Takes strings with one or more overrides, dictionaries with refs and values (e.g., {'a.b[0].x':3}) or |
|
Computes the value of all input overrides and returns overrides in pre-computed form. |
|
Takes a given set of overrides and updates them with a new set of overrides. |
Classes
|
An |
- soleil.overrides.overrides.OverrideSpec#
An override specification – Various possibilities:
# As a string 'a[0].b = 3' # As a multi-line or semicolon-separated string """ a[0].b = 3; x.y = 4 var.sub = a[0].b """ # As a dictionary {'a[0].b': 3, 'x.y':4, 'var.sub':a[0].b # As an Override object overrides = parse_overrides('a[0].b=3')[0]
alias of
Union[str,Dict[str,Any],Override]
- class soleil.overrides.overrides.PreCompOverride(target: VarPath, assign_type: OverrideType, value_expr: Expression, source: str | None = None, used: int = 0)#
Bases:
OverrideAn
Overridewith a pre-computed value.- get_value(*args, **kwargs)#
Extracts the assignment value from the specified globals and locals.
- soleil.overrides.overrides.cast_overrides(overrides: List[str | Dict[str, Any] | Override]) List[Override]#
Takes strings with one or more overrides, dictionaries with refs and values (e.g., {‘a.b[0].x’:3}) or
Overrideobjects obtained fromparse_overrides()and converts them to a list ofOverrideobjects.The output list can contain more elements than the input since both
stranddictoverride specifiers can contain multiple overrides.
- soleil.overrides.overrides.eval_overrides(overrides: str | Dict[str, Any] | Override | List[str | Dict[str, Any] | Override], globals_=None, locals_=None, check_unique=True) List[PreCompOverride]#
Computes the value of all input overrides and returns overrides in pre-computed form. If an entry is already an override in pre-computed form, that same object is returned for that entry.