class_docstr: Cast each param value to the respective parameter's type/format and
  to a flattened version of the hierarchical search space, if applicable.
  
  This is a default transform that should run across all models.
  
  NOTE: In case where searh space is hierarchical and this transform is
  configured to flatten it:
    * All calls to `Cast.transform_...` transform Ax objects defined in
      terms of hierarchical search space, to their definitions in terms of
      flattened search space.
    * All calls to `Cast.untransform_...` cast Ax objects back to a
      hierarchical search space.
    * The hierarchical search space is seen as the "original" search space,
      and the flattened search space –– as "transformed".
  
  Transform is done in-place for casting types, but objects are copied
  during flattening of- and casting to the hierarchical search space.
class_docstr_tok: ["Cast","each","param","value","to","the","respective","parameter","'s","type\/format","and","to","a","flattened","version","of","the","hierarchical","search","space",",","if","applicable",".","This","is","a","default","transform","that","should","run","across","all","models",".","NOTE",":","In","case","where","searh","space","is","hierarchical","and","this","transform","is","configured","to","flatten","it",":","*","All","calls","to","`","Cast.transform_","...","`","transform","Ax","objects","defined","in","terms","of","hierarchical","search","space",",","to","their","definitions","in","terms","of","flattened","search","space",".","*","All","calls","to","`","Cast.untransform_","...","`","cast","Ax","objects","back","to","a","hierarchical","search","space",".","*","The","hierarchical","search","space","is","seen","as","the","``","original","''","search","space",",","and","the","flattened","search","space","\u2013\u2013","as","``","transformed","''",".","Transform","is","done","in-place","for","casting","types",",","but","objects","are","copied","during","flattening","of-","and","casting","to","the","hierarchical","search","space","."]
docstr: Transform observation features by adding parameter values that
  were removed during casting of observation features to hierarchical
  search space.
  
  Args:
      observation_features: Observation features
  
  Returns: transformed observation features
docstr_tok: ["Transform","observation","features","by","adding","parameter","values","that","were","removed","during","casting","of","observation","features","to","hierarchical","search","space",".","Args",":","observation_features",":","Observation","features","Returns",":","transformed","observation","features"]
code: def transform_observation_features(
      self, observation_features: List[ObservationFeatures]
  ) -> List[ObservationFeatures]:
      """Transform observation features by adding parameter values that
      were removed during casting of observation features to hierarchical
      search space.
  
      Args:
          observation_features: Observation features
  
      Returns: transformed observation features
      """
      if not self.flatten_hss:
          return observation_features
      # Inject the parameters model suggested in the flat search space, which then
      # got removed during casting to HSS as they were not applicable under the
      # hierarchical structure of the search space.
      return [
          checked_cast(
              HierarchicalSearchSpace, self.search_space
          ).flatten_observation_features(observation_features=obs_feats)
          for obs_feats in observation_features
      ]
  
file_path: Ax/ax/modelbridge/transforms/cast.py
imports: from typing import List, Optional, TYPE_CHECKING
  from ax.core.observation import Observation, ObservationFeatures
  from ax.core.search_space import HierarchicalSearchSpace, SearchSpace
  from ax.modelbridge.transforms.base import Transform
  from ax.models.types import TConfig
  from ax.utils.common.typeutils import checked_cast, not_none
label_desc: Use image node_id 3 for calling the Cast obj's underlying member method code with example usage: obj.transform_observation_features(observation_features) and returns: unknown, observation_features