@@ -222,7 +222,7 @@ def propagate_data_to_dependencies(
222222 "ChannelFirst2d" ,
223223 "Upscale" , # TODO ***AL***
224224 "NonOverlapping" , # TODO ***AL***
225- "Store" , # TODO ***JH***
225+ "Store" ,
226226 "Squeeze" ,
227227 "Unsqueeze" ,
228228 "ExpandDims" ,
@@ -8804,9 +8804,9 @@ def _resample_volume_position(
88048804class Store (Feature ):
88058805 """Store the output of a feature for reuse.
88068806
8807- The `Store` feature evaluates a given feature and stores its output in an
8808- internal dictionary. Subsequent calls with the same key will return the
8809- stored value unless the `replace` parameter is set to `True`. This enables
8807+ The `Store` feature evaluates a given feature and stores its output in an
8808+ internal dictionary. Subsequent calls with the same key will return the
8809+ stored value unless the `replace` parameter is set to `True`. This enables
88108810 caching and reuse of computed feature outputs.
88118811
88128812 Parameters
@@ -8815,10 +8815,10 @@ class Store(Feature):
88158815 The feature to evaluate and store.
88168816 key: Any
88178817 The key used to identify the stored output.
8818- replace: bool, optional
8819- If `True`, replaces the stored value with a new computation. It defaults
8820- to `False`.
8821- **kwargs:: dict of str to Any
8818+ replace: PropertyLike[ bool] , optional
8819+ If `True`, replaces the stored value with the current computation. It
8820+ defaults to `False`.
8821+ **kwargs: dict of str to Any
88228822 Additional keyword arguments passed to the parent `Feature` class.
88238823
88248824 Attributes
@@ -8852,12 +8852,16 @@ class Store(Feature):
88528852 >>> cached_output = store_feature(None, key="example", replace=False)
88538853 >>> print(cached_output == output)
88548854 True
8855+ >>> print(cached_output == value_feature())
8856+ False
88558857
88568858 Retrieve the stored value recomputing:
88578859 >>> value_feature.update()
88588860 >>> cached_output = store_feature(None, key="example", replace=True)
88598861 >>> print(cached_output == output)
88608862 False
8863+ >>> print(cached_output == value_feature())
8864+ True
88618865
88628866 """
88638867
@@ -8867,7 +8871,7 @@ def __init__(
88678871 self : Store ,
88688872 feature : Feature ,
88698873 key : Any ,
8870- replace : bool = False ,
8874+ replace : PropertyLike [ bool ] = False ,
88718875 ** kwargs : Any ,
88728876 ):
88738877 """Initialize the Store feature.
@@ -8878,8 +8882,8 @@ def __init__(
88788882 The feature to evaluate and store.
88798883 key: Any
88808884 The key used to identify the stored output.
8881- replace: bool, optional
8882- If `True`, replaces the stored value with a new computation.
8885+ replace: PropertyLike[ bool] , optional
8886+ If `True`, replaces the stored value with a new computation.
88838887 It defaults to `False`.
88848888 **kwargs:: dict of str to Any
88858889 Additional keyword arguments passed to the parent `Feature` class.
@@ -8918,7 +8922,7 @@ def get(
89188922 """
89198923
89208924 # Check if the value should be recomputed or retrieved from the store
8921- if replace or not ( key in self ._store ) :
8925+ if replace or not key in self ._store :
89228926 self ._store [key ] = self .feature ()
89238927
89248928 # Return the stored or newly computed result
0 commit comments