permitted_dep_add
- pyoptex.utils.model.permitted_dep_add(model, mode=None, dep=None, subset=None)[source]
Computes which terms are permitted to be added to this model such that adding any of the returned terms does not violate the heredity constraints.
Note
Does not check whether the term already exists in the model.
Parameters
- modelnp.array(1d)
The current model.
- modeNone, ‘weak’ or ‘strong’
The heredity mode to adhere to.
- depnp.array(2d)
The dependency matrix of size (N, N) with N the number of terms in the encoded model (output from Y2X). Term i depends on term j if dep(i, j) = true.
- subsetnp.array(1d)
The subset of terms to validate. If None, all terms are validated.
Returns
- validnp.ndarray(1d)
A boolean array indicating which terms are valid to be added. Has the same length as the subset.