AttrConstraint
- class jwst.associations.lib.constraint.AttrConstraint(*args, **kwargs)[source]
Bases:
SimpleConstraintABCTest attribute of an item.
- Parameters:
- sources[str[,…]]
List of attributes to query
- evaluatebool
Evaluate the item’s value before checking condition.
- force_reprocessListCategory.state or False
Add item back onto the reprocess list using the specified
ProcessListwork over state.- force_uniquebool
If the initial value is
Noneor 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_matchbool
If
force_reprocess, only do the reprocess if the entire constraint is satisfied.- onlyiffunction
Boolean function that takes
itemas argument. If True, the rest of the condition is checked. Otherwise return as a matched condition.- requiredbool
One of the sources must exist. Otherwise, return as a matched constraint.
- Attributes:
- found_valuesset(str[,…])
Set of actual found values for this condition.
- matchedbool
Last result of
check_and_set().
Force creation of the constraint attribute dict before anything else.
- Returns:
SimpleConstraintABCNew instance of class.
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:
- itemdict
The item to check on.
- Returns:
- successbool
True if check is successful.
- reprocesslist of
ProcessList List of ProcessLists.