AttrConstraint
- class jwst.associations.lib.constraint.AttrConstraint(*args, **kwargs)[source]
Bases:
SimpleConstraintABC
Test attribute of an item.
- matched
Last result of
check_and_set
- Type:
Initialize a new AttrConstraint.
- Parameters:
sources ([str[,...]]) – List of attributes to query
evaluate (bool) – Evaluate the item’s value before checking condition.
force_reprocess (ListCategory.state or False) – Add item back onto the reprocess list using the specified
ProcessList
work over state.force_unique (bool) – If the initial value is
None
or a list of possible values, the constraint will be modified to be the value first matched.invalid_values ([str[,...]]) – List of values that are invalid in an item. Will cause a non-match.
only_on_match (bool) – If
force_reprocess
, only do the reprocess if the entire constraint is satisfied.onlyif (function) – Boolean function that takes
item
as argument. If True, the rest of the condition is checked. Otherwise return as a matched conditionrequired (bool) – One of the sources must exist. Otherwise, return as a matched constraint.
Methods Summary
check_and_set
(item)Check and set constraints based on item.
Methods Documentation
- check_and_set(item)[source]
Check and set constraints based on item.
- Parameters:
item (dict) – The item to check on.
- Returns:
success, reprocess –
Returns 2-tuple of
True if check is successful.
List of
ProcessList
.
- Return type:
bool, [ProcessList[,…]]