Asking if a graph has a sensitivity field always returns false.
The Problem
On the graph, we have the method: computes_field
which determines if a graph computes the supplied field.
Presently, this looks at the Factory to see if an expression has been registered to compute that field. This is problematic because:
- The factory is only aware of the fields an expression computes directly - not sensitivity fields.
- Sensitivity fields are only associated with expressions if
compute_sensitivities
is called on theExpressionTree
Possible Solution
Instead of looking in the factory to determine if a field is computed, we could do this another way. On the ExpressionTree
, we could aggregate a list of computed fields, which would be augmented when we activate sensitivities.
This would duplicate a lot of information available on the ExpressionFactory
(and also on the ExpressionRegistry
), but may be the only way to handle this.
When cleaving, we may need to regenerate the list of computed fields.