class_docstr: Cutting 2d environment state to dictionary observation.
  
  :param max_pieces_in_inventory: Size of the inventory. If inventory gets full, the oldest pieces get discarded.
  :param raw_piece_size: Size of a fresh raw (= full-size) piece
class_docstr_tok: ["Cutting","2d","environment","state","to","dictionary","observation",".",":","param","max_pieces_in_inventory",":","Size","of","the","inventory",".","If","inventory","gets","full",",","the","oldest","pieces","get","discarded",".",":","param","raw_piece_size",":","Size","of","a","fresh","raw","(","=","full-size",")","piece"]
docstr: Return the Gym dict observation space based on the given params.
  
  :return: Gym space object
      - inventory: max_pieces_in_inventory x 2 (x/y-dimensions of pieces in inventory)
      - inventory_size: scalar number of pieces in inventory
      - ordered_piece: 2d vector holding x/y-dimension of customer ordered piece
docstr_tok: ["Return","the","Gym","dict","observation","space","based","on","the","given","params",".",":","return",":","Gym","space","object","-","inventory",":","max_pieces_in_inventory","x","2","(","x\/y-dimensions","of","pieces","in","inventory",")","-","inventory_size",":","scalar","number","of","pieces","in","inventory","-","ordered_piece",":","2d","vector","holding","x\/y-dimension","of","customer","ordered","piece"]
code: def space(self) -> spaces.Dict:
      """Return the Gym dict observation space based on the given params.
  
      :return: Gym space object
          - inventory: max_pieces_in_inventory x 2 (x/y-dimensions of pieces in inventory)
          - inventory_size: scalar number of pieces in inventory
          - ordered_piece: 2d vector holding x/y-dimension of customer ordered piece
      """
      return spaces.Dict(
          {
              "inventory": spaces.Box(
                  low=np.zeros(
                      (self.max_pieces_in_inventory, 2),
                      dtype=np.float32,
                  ),
                  high=np.vstack(
                      [
                          [
                              self.raw_piece_size[0] + 1,
                              self.raw_piece_size[1] + 1,
                          ]
                      ]
                      * self.max_pieces_in_inventory
                  ).astype(np.float32),
                  dtype=np.float32,
              ),
              "inventory_size": spaces.Box(
                  low=np.float32(0),
                  high=self.max_pieces_in_inventory + 1,
                  shape=(1,),
                  dtype=np.float32,
              ),
              "ordered_piece": spaces.Box(
                  low=np.float32(0),
                  high=np.float32(max(self.raw_piece_size) + 1),
                  shape=(2,),
                  dtype=np.float32,
              ),
          }
      )
  
file_path: maze/tutorials/tutorial_maze_env/part03_maze_env/space_interfaces/dict_observation_conversion.py
imports: import numpy
  from typing import Dict
  from gym import spaces
  from maze.core.annotations import override
  from maze.core.env.observation_conversion import ObservationConversionInterface
  from ..env.maze_state import Cutting2DMazeState
label_desc: Use image node_id 4 for calling the ObservationConversion obj's underlying member method code with example usage: obj.space() and returns: spaces