class_docstr: Allows keeping only parts of the observation, by specifying their
  name. This is useful when the environment has a measurements vector as observation which includes several different
  measurements, but you want the agent to only see some of the measurements and not all.
  For example, the CARLA environment extracts multiple measurements that can be used by the agent, such as
  speed and location. If we want to only use the speed, it can be done using this filter.
  This will currently work only for VectorObservationSpace observations
class_docstr_tok: ["Allows","keeping","only","parts","of","the","observation",",","by","specifying","their","name",".","This","is","useful","when","the","environment","has","a","measurements","vector","as","observation","which","includes","several","different","measurements",",","but","you","want","the","agent","to","only","see","some","of","the","measurements","and","not","all",".","For","example",",","the","CARLA","environment","extracts","multiple","measurements","that","can","be","used","by","the","agent",",","such","as","speed","and","location",".","If","we","want","to","only","use","the","speed",",","it","can","be","done","using","this","filter",".","This","will","currently","work","only","for","VectorObservationSpace","observations"]
docstr: :param part_names: A list of part names to reduce
  :param reduction_method: A reduction method to use - keep or discard the given parts
docstr_tok: [":","param","part_names",":","A","list","of","part","names","to","reduce",":","param","reduction_method",":","A","reduction","method","to","use","-","keep","or","discard","the","given","parts"]
code: def __init__(
      self, part_names: List[str], reduction_method: ReductionMethod
  ):
      """
      :param part_names: A list of part names to reduce
      :param reduction_method: A reduction method to use - keep or discard the given parts
      """
      super().__init__()
      self.part_names = part_names
      self.reduction_method = reduction_method
      self.measurement_names = None
      self.indices_to_keep = None
  
file_path: coach/rl_coach/filters/observation/observation_reduction_by_sub_parts_name_filter.py
imports: import copy
  from enum import Enum
  from typing import List
  import numpy
  from rl_coach.core_types import ObservationType
  from rl_coach.filters.observation.observation_filter import ObservationFilter
  from rl_coach.spaces import ObservationSpace, VectorObservationSpace
label_desc: Use image node_id 1 to create a new ObservationReductionBySubPartsNameFilter object from inherited base classes: ObservationFilter with example: obj = ObservationReductionBySubPartsNameFilter(part_names, reduction_method)