Skip to content

unienv_data.storages.dict_storage

DictStorage

DictStorage(single_instance_space: DictSpace[BDeviceType, BDtypeType, BRNGType], storage_map: Dict[str, SpaceStorage[BArrayType, BArrayType, BDeviceType, BDtypeType, BRNGType]], cache_filename: Optional[Union[str, PathLike]] = None, nested_separator: str = '/')

Bases: SpaceStorage[Dict[str, Any], BArrayType, BDeviceType, BDtypeType, BRNGType]

single_file_ext class-attribute instance-attribute

single_file_ext = None

storage_map instance-attribute

storage_map = storage_map

nested_separator instance-attribute

nested_separator = nested_separator

cache_filename property

cache_filename: Optional[Union[str, PathLike]]

is_mutable property

is_mutable: bool

is_multiprocessing_safe property

is_multiprocessing_safe: bool

capacity property

capacity: Optional[int]

backend property

backend: ComputeBackend[BArrayType, BDeviceType, BDtypeType, BRNGType]

device property

device: Optional[BDeviceType]

single_instance_space instance-attribute

single_instance_space = single_instance_space

create classmethod

create(single_instance_space: Space[Any, BDeviceType, BDtypeType, BRNGType], storage_cls_map: Dict[str, Type[SpaceStorage]], *args, capacity: Optional[int] = None, cache_path: Optional[str] = None, multiprocessing: bool = False, key_kwargs: Dict[str, Any] = {}, type_kwargs: Dict[Type[SpaceStorage[Any, BArrayType, BDeviceType, BDtypeType, BRNGType]], Dict[str, Any]] = {}, nested_separator: str = '/', **kwargs) -> DictStorage[BArrayType, BDeviceType, BDtypeType, BRNGType]

load_from classmethod

load_from(path: Union[str, PathLike], single_instance_space: Space[Any, BDeviceType, BDtypeType, BRNGType], *, capacity: Optional[int] = None, read_only: bool = True, multiprocessing: bool = False, key_kwargs: Dict[str, Any] = {}, type_kwargs: Dict[Type[SpaceStorage[Any, BArrayType, BDeviceType, BDtypeType, BRNGType]], Dict[str, Any]] = {}, **kwargs) -> DictStorage[BArrayType, BDeviceType, BDtypeType, BRNGType]

extend_length

extend_length(length)

shrink_length

shrink_length(length)

get_flattened

get_flattened(index)

get

get(index)

set_flattened

set_flattened(index, value)

set

set(index, value)

get_subspace_by_key

get_subspace_by_key(key: str) -> Space[Any, BDeviceType, BDtypeType, BRNGType]

get_column

get_column(nested_keys: Sequence[str]) -> SpaceStorage[Any, BDeviceType, BDtypeType, BRNGType]

clear

clear()

dumps

dumps(path)

close

close()

map_transform

map_transform(data: Dict[str, Any], value_map: Dict[str, Any], fn: Callable[[str, Any, Any], Any], prefix: str = '', nested_separator: str = '/') -> Tuple[Dict[str, Any], Dict[str, Any]]

get_chained_residual_space

get_chained_residual_space(space: DictSpace[BDeviceType, BDtypeType, BRNGType], all_keys: List[str], prefix: str = '', nested_separator: str = '/') -> Optional[DictSpace[BDeviceType, BDtypeType, BRNGType]]

get_chained_space

get_chained_space(space: DictSpace[BDeviceType, BDtypeType, BRNGType], key_chain: str, all_keys: List[str], nested_separator: str = '/') -> Optional[Space[Any, BDeviceType, BDtypeType, BRNGType]]