propagate_data_to_dependencies#
- deeptrack.features.propagate_data_to_dependencies(feature: Feature, **kwargs: dict[str, Any]) None#
Updates the properties of dependencies in a feature’s dependency tree.
This function traverses the dependency tree of the given feature and updates the properties of each dependency based on the provided keyword arguments. Only properties that already exist in the PropertyDict of a dependency are updated.
By dynamically updating the properties in the dependency tree, this function ensures that any changes in the feature’s context or configuration are propagated correctly to its dependencies.
Parameters#
- feature: Feature
The feature whose dependencies are to be updated. The dependencies are recursively traversed to ensure that all relevant nodes in the dependency tree are considered.
- **kwargs: dict of str, Any
Key-value pairs specifying the property names and their corresponding values to be set in the dependencies. Only properties that exist in the PropertyDict of a dependency will be updated.
Examples#
>>> import deeptrack as dt
Update the properties of a feature and its dependencies: >>> feature = dt.DummyFeature(value=10) >>> dt.propagate_data_to_dependencies(feature, value=20) >>> feature.value() 20
This will update the value property of the feature and its dependencies, provided they have a property named value.