Source code for minari.data_collector.callbacks.episode_metadata
-from typing import Dict
+from typing import Dict
[docs]
-class EpisodeMetadataCallback:
+class EpisodeMetadataCallback:
"""Callback to full episode after saving to hdf5 file as a group.
This callback can be overridden to add extra metadata attributes or statistics to
@@ -815,7 +815,7 @@ Source code for minari.data_collector.callbacks.episode_metadata
passed to the DataCollector wrapper to the `episode_metadata_callback` argument.
"""
- def __call__(self, episode: Dict) -> Dict:
+ def __call__(self, episode: Dict) -> Dict:
"""Callback method.
Override this method to add custom attribute metadata to the episode group.
diff --git a/main/_modules/minari/data_collector/callbacks/step_callback/index.html b/main/_modules/minari/data_collector/callbacks/step_callback/index.html
index 659aebb1..233a2a9b 100644
--- a/main/_modules/minari/data_collector/callbacks/step_callback/index.html
+++ b/main/_modules/minari/data_collector/callbacks/step_callback/index.html
@@ -12,7 +12,7 @@
minari.data_collector.callbacks.step_callback - Minari Documentation
-
+
@@ -802,23 +802,23 @@
Source code for minari.data_collector.callbacks.step_callback
-from typing import Any, Dict, Optional
+from typing import Any, Dict, Optional
-import gymnasium as gym
+import gymnasium as gym
-from minari.dataset.step_data import StepData
+from minari.dataset.step_data import StepData
[docs]
-class StepDataCallback:
+class StepDataCallback:
"""Callback to create step data dictionary from the return data of each Gymnasium environment step.
This callback can be overridden to add extra environment information in each step or
edit the observation, action, reward, termination, truncation, or info returns.
"""
- def __call__(
+ def __call__(
self,
env: gym.Env,
obs: Any,
diff --git a/main/_modules/minari/data_collector/data_collector/index.html b/main/_modules/minari/data_collector/data_collector/index.html
index ef8a2432..c4a93095 100644
--- a/main/_modules/minari/data_collector/data_collector/index.html
+++ b/main/_modules/minari/data_collector/data_collector/index.html
@@ -12,7 +12,7 @@
minari.data_collector.data_collector - Minari Documentation
-
+
@@ -802,27 +802,27 @@
Source code for minari.data_collector.data_collector
-from __future__ import annotations
+from __future__ import annotations
-import copy
-import os
-import secrets
-import shutil
-import tempfile
-import warnings
-from typing import Any, Callable, Dict, Optional, SupportsFloat, Type
+import copy
+import os
+import secrets
+import shutil
+import tempfile
+import warnings
+from typing import Any, Callable, Dict, Optional, SupportsFloat, Type
-import gymnasium as gym
-import numpy as np
-from gymnasium.core import ActType, ObsType
-from gymnasium.envs.registration import EnvSpec
+import gymnasium as gym
+import numpy as np
+from gymnasium.core import ActType, ObsType
+from gymnasium.envs.registration import EnvSpec
-from minari.data_collector.callbacks import EpisodeMetadataCallback, StepDataCallback
-from minari.data_collector.episode_buffer import EpisodeBuffer
-from minari.dataset.minari_dataset import MinariDataset, parse_dataset_id
-from minari.dataset.minari_storage import MinariStorage
-from minari.namespace import create_namespace, list_local_namespaces
-from minari.utils import _generate_dataset_metadata, _generate_dataset_path
+from minari.data_collector.callbacks import EpisodeMetadataCallback, StepDataCallback
+from minari.data_collector.episode_buffer import EpisodeBuffer
+from minari.dataset.minari_dataset import MinariDataset, parse_dataset_id
+from minari.dataset.minari_storage import MinariStorage
+from minari.namespace import create_namespace, list_local_namespaces
+from minari.utils import _generate_dataset_metadata, _generate_dataset_path
# H5Py supports ints up to uint64
@@ -831,7 +831,7 @@ Source code for minari.data_collector.data_collector
[docs]
-class DataCollector(gym.Wrapper):
+class DataCollector(gym.Wrapper):
r"""Gymnasium environment wrapper that collects step data.
This wrapper is meant to work as a temporary buffer of the environment data before creating a Minari dataset. The creation of the buffers
@@ -866,7 +866,7 @@ Source code for minari.data_collector.data_collector
"""
- def __init__(
+ def __init__(
self,
env: gym.Env,
step_data_callback: Type[StepDataCallback] = StepDataCallback,
@@ -914,7 +914,7 @@ Source code for minari.data_collector.data_collector
self._episode_id = 0
self._reset_storage()
- def _reset_storage(self):
+ def _reset_storage(self):
self._episode_id = 0
self._tmp_dir = tempfile.TemporaryDirectory(dir=self.datasets_path)
data_format_kwarg = (
@@ -928,7 +928,7 @@ Source code for minari.data_collector.data_collector
**data_format_kwarg,
)
- def step(
+ def step(
self, action: ActType
) -> tuple[ObsType, SupportsFloat, bool, bool, dict[str, Any]]:
"""Gymnasium step method."""
@@ -971,7 +971,7 @@ Source code for minari.data_collector.data_collector
return obs, rew, terminated, truncated, info
- def reset(
+ def reset(
self,
*,
seed: int | None = None,
@@ -1016,7 +1016,7 @@ Source code for minari.data_collector.data_collector
)
return obs, info
- def add_to_dataset(self, dataset: MinariDataset):
+ def add_to_dataset(self, dataset: MinariDataset):
"""Add extra data to Minari dataset from collector environment buffers (DataCollector).
Args:
@@ -1032,7 +1032,7 @@ Source code for minari.data_collector.data_collector
self._reset_storage()
- def create_dataset(
+ def create_dataset(
self,
dataset_id: str,
eval_env: Optional[str | gym.Env | EnvSpec] = None,
@@ -1097,7 +1097,7 @@ Source code for minari.data_collector.data_collector
self._save_to_disk(dataset_path, metadata)
return MinariDataset(dataset_path)
- def _flush_to_storage(self):
+ def _flush_to_storage(self):
if self._buffer is not None and len(self._buffer) > 0:
if not self._buffer.terminations[-1]:
self._buffer.truncations[-1] = True
@@ -1105,7 +1105,7 @@ Source code for minari.data_collector.data_collector
self._episode_id += 1
self._buffer = None
- def _save_to_disk(
+ def _save_to_disk(
self, path: str | os.PathLike, dataset_metadata: Dict[str, Any] = {}
):
"""Save all in-memory buffer data and move temporary files to a permanent location in disk.
@@ -1139,7 +1139,7 @@ Source code for minari.data_collector.data_collector
self._reset_storage()
- def close(self):
+ def close(self):
"""Close the DataCollector.
Clear buffer and close temporary directory.
@@ -1150,7 +1150,7 @@ Source code for minari.data_collector.data_collector
def _check_infos_same_shape(info_1: dict, info_2: dict):
+def _check_infos_same_shape(info_1: dict, info_2: dict):
if info_1.keys() != info_2.keys():
return False
for key in info_1.keys():
diff --git a/main/_modules/minari/data_collector/episode_buffer/index.html b/main/_modules/minari/data_collector/episode_buffer/index.html
index 9823a4a7..243d1bf6 100644
--- a/main/_modules/minari/data_collector/episode_buffer/index.html
+++ b/main/_modules/minari/data_collector/episode_buffer/index.html
@@ -12,7 +12,7 @@
minari.data_collector.episode_buffer - Minari Documentation
-
+
@@ -802,18 +802,18 @@
Source code for minari.data_collector.episode_buffer
-from __future__ import annotations
+from __future__ import annotations
-from dataclasses import dataclass, field
-from typing import Optional, Union
+from dataclasses import dataclass, field
+from typing import Optional, Union
-from minari.dataset.step_data import StepData
+from minari.dataset.step_data import StepData
[docs]
@dataclass(frozen=True)
-class EpisodeBuffer:
+class EpisodeBuffer:
"""Contains the data of a single episode."""
id: Optional[int] = None
@@ -826,7 +826,7 @@ Source code for minari.data_collector.episode_buffer
truncations: list = field(default_factory=list)
infos: Optional[dict] = None
- def add_step_data(self, step_data: StepData) -> EpisodeBuffer:
+ def add_step_data(self, step_data: StepData) -> EpisodeBuffer:
"""Add step data dictionary to episode buffer.
Args:
@@ -836,13 +836,13 @@ Source code for minari.data_collector.episode_buffer
EpisodeBuffer: episode buffer with appended data
"""
try:
- import jax.tree_util as jtu
+ import jax.tree_util as jtu
except ImportError:
raise ImportError(
'jax is not installed. Please install it using `pip install "minari[create]"`'
)
- def _append(data, buffer):
+ def _append(data, buffer):
if isinstance(buffer, list):
buffer.append(data)
return buffer
@@ -881,7 +881,7 @@ Source code for minari.data_collector.episode_buffer
infos=infos,
)
- def __len__(self) -> int:
+ def __len__(self) -> int:
"""Buffer length."""
return len(self.rewards)
diff --git a/main/_modules/minari/dataset/episode_data/index.html b/main/_modules/minari/dataset/episode_data/index.html
index 2ae00c7f..d55647a5 100644
--- a/main/_modules/minari/dataset/episode_data/index.html
+++ b/main/_modules/minari/dataset/episode_data/index.html
@@ -12,7 +12,7 @@
minari.dataset.episode_data - Minari Documentation
-
+
@@ -802,16 +802,16 @@
Source code for minari.dataset.episode_data
-from dataclasses import dataclass
-from typing import Any
+from dataclasses import dataclass
+from typing import Any
-import numpy as np
+import numpy as np
[docs]
@dataclass(frozen=True)
-class EpisodeData:
+class EpisodeData:
"""Contains the datasets data for a single episode."""
id: int
@@ -822,10 +822,10 @@ Source code for minari.dataset.episode_data
truncations: np.ndarray
infos: dict
- def __len__(self) -> int:
+ def __len__(self) -> int:
return len(self.rewards)
- def __repr__(self) -> str:
+ def __repr__(self) -> str:
return (
"EpisodeData("
f"id={self.id}, "
@@ -840,7 +840,7 @@ Source code for minari.dataset.episode_data
)
@staticmethod
- def _repr_space_values(value):
+ def _repr_space_values(value):
if isinstance(value, np.ndarray):
return f"ndarray of shape {value.shape} and dtype {value.dtype}"
elif isinstance(value, dict):
diff --git a/main/_modules/minari/dataset/minari_dataset/index.html b/main/_modules/minari/dataset/minari_dataset/index.html
index 7d969b9a..85a63aee 100644
--- a/main/_modules/minari/dataset/minari_dataset/index.html
+++ b/main/_modules/minari/dataset/minari_dataset/index.html
@@ -12,7 +12,7 @@
minari.dataset.minari_dataset - Minari Documentation
-
+
@@ -802,26 +802,26 @@
Source code for minari.dataset.minari_dataset
-from __future__ import annotations
+from __future__ import annotations
-import importlib.metadata
-import logging
-import os
-import re
-import warnings
-from dataclasses import dataclass, field
-from typing import Callable, Iterable, Iterator, List
+import importlib.metadata
+import logging
+import os
+import re
+import warnings
+from dataclasses import dataclass, field
+from typing import Callable, Iterable, Iterator, List
-import gymnasium as gym
-import numpy as np
-import numpy.typing as npt
-from gymnasium.envs.registration import EnvSpec
-from packaging.requirements import InvalidRequirement, Requirement
-from packaging.version import Version
+import gymnasium as gym
+import numpy as np
+import numpy.typing as npt
+from gymnasium.envs.registration import EnvSpec
+from packaging.requirements import InvalidRequirement, Requirement
+from packaging.version import Version
-from minari.data_collector.episode_buffer import EpisodeBuffer
-from minari.dataset.episode_data import EpisodeData
-from minari.dataset.minari_storage import MinariStorage, PathLike
+from minari.data_collector.episode_buffer import EpisodeBuffer
+from minari.dataset.episode_data import EpisodeData
+from minari.dataset.minari_storage import MinariStorage, PathLike
VERSION_RE = r"(?:-v(?P<version>\d+))"
@@ -830,7 +830,7 @@ Source code for minari.dataset.minari_dataset
DATASET_ID_RE = re.compile(rf"^{NAMESPACE_RE}?{DATASET_NAME_RE}{VERSION_RE}?$")
-def parse_dataset_id(dataset_id: str) -> tuple[str | None, str, int]:
+def parse_dataset_id(dataset_id: str) -> tuple[str | None, str, int]:
"""Parse dataset ID string format - ``(namespace/)dataset_name(-v[version])``.
Args:
@@ -855,7 +855,7 @@ Source code for minari.dataset.minari_dataset
return namespace, dataset_name, version
-def gen_dataset_id(
+def gen_dataset_id(
namespace: str | None,
dataset_name: str,
version: int | None = None,
@@ -878,7 +878,7 @@ Source code for minari.dataset.minari_dataset
@dataclass
-class MinariDatasetSpec:
+class MinariDatasetSpec:
env_spec: EnvSpec | None
total_episodes: int
total_steps: int
@@ -894,7 +894,7 @@ Source code for minari.dataset.minari_dataset
dataset_name: str = field(init=False)
version: int | None = field(init=False)
- def __post_init__(self):
+ def __post_init__(self):
"""Calls after the spec is created to extract the environment name, dataset name and version from the dataset id."""
(
self.namespace,
@@ -905,10 +905,10 @@ Source code for minari.dataset.minari_dataset
[docs]
-class MinariDataset:
+class MinariDataset:
"""Main Minari dataset class to sample data and get metadata information from a dataset."""
- def __init__(
+ def __init__(
self,
data: MinariStorage | PathLike,
episode_indices: npt.NDArray[np.int_] | None = None,
@@ -963,7 +963,7 @@ Source code for minari.dataset.minari_dataset
minari_version = metadata["minari_version"]
assert isinstance(minari_version, str)
- from minari import __version__, supported_dataset_versions
+ from minari import __version__, supported_dataset_versions
if minari_version not in supported_dataset_versions:
raise ValueError(
@@ -981,7 +981,7 @@ Source code for minari.dataset.minari_dataset
self._generator = np.random.default_rng()
- def recover_environment(self, eval_env: bool = False, **kwargs) -> gym.Env:
+ def recover_environment(self, eval_env: bool = False, **kwargs) -> gym.Env:
"""Recover the Gymnasium environment used to create the dataset.
Args:
@@ -1024,11 +1024,11 @@ Source code for minari.dataset.minari_dataset
return gym.make(self.env_spec, **kwargs)
- def set_seed(self, seed: int):
+ def set_seed(self, seed: int):
"""Set seed for random episode sampling generator."""
self._generator = np.random.default_rng(seed)
- def filter_episodes(
+ def filter_episodes(
self, condition: Callable[[EpisodeData], bool]
) -> MinariDataset:
"""Filter the dataset episodes with a condition.
@@ -1045,7 +1045,7 @@ Source code for minari.dataset.minari_dataset
condition (Callable[[EpisodeData], bool]): function that gets in input an EpisodeData object and returns True if certain condition is met.
"""
- def dict_to_episode_data_condition(episode: dict) -> bool:
+ def dict_to_episode_data_condition(episode: dict) -> bool:
return condition(EpisodeData(**episode))
mask = self.storage.apply(
@@ -1055,7 +1055,7 @@ Source code for minari.dataset.minari_dataset
filtered_indices = self.episode_indices[list(mask)]
return MinariDataset(self.storage, episode_indices=filtered_indices)
- def sample_episodes(self, n_episodes: int) -> Iterable[EpisodeData]:
+ def sample_episodes(self, n_episodes: int) -> Iterable[EpisodeData]:
"""Sample n number of episodes from the dataset.
Args:
@@ -1067,7 +1067,7 @@ Source code for minari.dataset.minari_dataset
episodes = self.storage.get_episodes(indices)
return list(map(lambda data: EpisodeData(**data), episodes))
- def iterate_episodes(
+ def iterate_episodes(
self, episode_indices: Iterable[int] | None = None
) -> Iterator[EpisodeData]:
"""Iterate over episodes from the dataset.
@@ -1084,7 +1084,7 @@ Source code for minari.dataset.minari_dataset
episodes_data = self.storage.get_episodes(episode_indices)
return map(lambda data: EpisodeData(**data), episodes_data)
- def update_dataset_from_buffer(self, buffer: List[EpisodeBuffer]):
+ def update_dataset_from_buffer(self, buffer: List[EpisodeBuffer]):
"""Additional data can be added to the Minari Dataset from a list of episode dictionary buffers.
Args:
@@ -1096,23 +1096,23 @@ Source code for minari.dataset.minari_dataset
self.episode_indices, first_id + np.arange(len(buffer))
)
- def __iter__(self):
+ def __iter__(self):
return self.iterate_episodes()
- def __getitem__(self, idx: int) -> EpisodeData:
+ def __getitem__(self, idx: int) -> EpisodeData:
episode = self.iterate_episodes([self.episode_indices[idx]])
return next(episode)
- def __len__(self) -> int:
+ def __len__(self) -> int:
return self.total_episodes
@property
- def total_episodes(self) -> int:
+ def total_episodes(self) -> int:
"""Total number of episodes in the Minari dataset."""
return len(self.episode_indices)
@property
- def total_steps(self) -> int:
+ def total_steps(self) -> int:
"""Total episodes steps in the Minari dataset."""
if self._total_steps is None:
self._total_steps = 0
@@ -1122,32 +1122,32 @@ Source code for minari.dataset.minari_dataset
return int(self._total_steps)
@property
- def episode_indices(self) -> npt.NDArray[np.int_]:
+ def episode_indices(self) -> npt.NDArray[np.int_]:
"""Indices of the available episodes to sample within the Minari dataset."""
return self._episode_indices
@episode_indices.setter
- def episode_indices(self, new_value: npt.NDArray[np.int_]):
+ def episode_indices(self, new_value: npt.NDArray[np.int_]):
self._total_steps = None # invalidate cache
self._episode_indices = new_value
@property
- def observation_space(self):
+ def observation_space(self):
"""Original observation space of the environment before flatteining (if this is the case)."""
return self._observation_space
@property
- def action_space(self):
+ def action_space(self):
"""Original action space of the environment before flatteining (if this is the case)."""
return self._action_space
@property
- def env_spec(self):
+ def env_spec(self):
"""Envspec of the environment that has generated the dataset."""
return self._env_spec
@property
- def combined_datasets(self) -> List[str]:
+ def combined_datasets(self) -> List[str]:
"""If this Minari dataset is a combination of other subdatasets, return a list with the subdataset names."""
if self._combined_datasets is None:
return []
@@ -1155,22 +1155,22 @@ Source code for minari.dataset.minari_dataset
return self._combined_datasets
@property
- def id(self) -> str:
+ def id(self) -> str:
"""Name of the Minari dataset."""
return self._dataset_id
@property
- def minari_version(self) -> str:
+ def minari_version(self) -> str:
"""Version of Minari the dataset is compatible with."""
return self._minari_version
@property
- def storage(self) -> MinariStorage:
+ def storage(self) -> MinariStorage:
"""Minari storage managing access to disk."""
return self._data
@property
- def spec(self) -> MinariDatasetSpec:
+ def spec(self) -> MinariDatasetSpec:
"""Minari dataset specifier."""
return MinariDatasetSpec(
env_spec=self.env_spec,
diff --git a/main/_modules/minari/dataset/minari_storage/index.html b/main/_modules/minari/dataset/minari_storage/index.html
index 2370ad73..fcef5e34 100644
--- a/main/_modules/minari/dataset/minari_storage/index.html
+++ b/main/_modules/minari/dataset/minari_storage/index.html
@@ -12,7 +12,7 @@
minari.dataset.minari_storage - Minari Documentation
-
+
@@ -802,21 +802,21 @@
Source code for minari.dataset.minari_storage
-from __future__ import annotations
+from __future__ import annotations
-import json
-import os
-import pathlib
-import warnings
-from abc import ABC, abstractmethod
-from typing import Any, Callable, Dict, Iterable, Optional, Union
+import json
+import os
+import pathlib
+import warnings
+from abc import ABC, abstractmethod
+from typing import Any, Callable, Dict, Iterable, Optional, Union
-import gymnasium as gym
-import numpy as np
-from gymnasium.envs.registration import EnvSpec
+import gymnasium as gym
+import numpy as np
+from gymnasium.envs.registration import EnvSpec
-from minari.data_collector.episode_buffer import EpisodeBuffer
-from minari.serialization import deserialize_space, serialize_space
+from minari.data_collector.episode_buffer import EpisodeBuffer
+from minari.serialization import deserialize_space, serialize_space
PathLike = Union[str, os.PathLike]
@@ -825,12 +825,12 @@ Source code for minari.dataset.minari_storage
[docs]
-class MinariStorage(ABC):
+class MinariStorage(ABC):
"""Class that handles disk access to the data."""
FORMAT: str
- def __init__(
+ def __init__(
self,
data_path: pathlib.Path,
observation_space: gym.Space,
@@ -841,7 +841,7 @@ Source code for minari.dataset.minari_storage
self._action_space = action_space
@classmethod
- def read_raw_metadata(cls, data_path: PathLike) -> Dict[str, Any]:
+ def read_raw_metadata(cls, data_path: PathLike) -> Dict[str, Any]:
"""Read the raw metadata from a path.
Args:
@@ -864,7 +864,7 @@ Source code for minari.dataset.minari_storage
return metadata
@classmethod
- def read(cls, data_path: PathLike) -> MinariStorage:
+ def read(cls, data_path: PathLike) -> MinariStorage:
"""Create a MinariStorage to read data from a path.
Args:
@@ -904,7 +904,7 @@ Source code for minari.dataset.minari_storage
if action_space is None:
action_space = env.action_space
- from minari.dataset._storages import get_minari_storage # avoid circular import
+ from minari.dataset._storages import get_minari_storage # avoid circular import
return get_minari_storage(metadata["data_format"])(
pathlib.Path(data_path),
@@ -913,7 +913,7 @@ Source code for minari.dataset.minari_storage
)
@classmethod
- def new(
+ def new(
cls,
data_path: PathLike,
observation_space: Optional[gym.Space] = None,
@@ -941,7 +941,7 @@ Source code for minari.dataset.minari_storage
raise ValueError(
"Since env_spec is not specified, you need to specify both action space and observation space"
)
- from minari.dataset._storages import ( # avoid circular import
+ from minari.dataset._storages import ( # avoid circular import
get_minari_storage,
get_storage_keys,
)
@@ -991,7 +991,7 @@ Source code for minari.dataset.minari_storage
@classmethod
@abstractmethod
- def _create(
+ def _create(
cls,
data_path: pathlib.Path,
observation_space: gym.Space,
@@ -999,7 +999,7 @@ Source code for minari.dataset.minari_storage
) -> MinariStorage: ...
@property
- def metadata(self) -> Dict[str, Any]:
+ def metadata(self) -> Dict[str, Any]:
"""Metadata of the dataset."""
metadata = MinariStorage.read_raw_metadata(self.data_path)
@@ -1011,7 +1011,7 @@ Source code for minari.dataset.minari_storage
metadata["author_email"] = set(metadata["author_email"])
return metadata
- def update_metadata(self, metadata: Dict):
+ def update_metadata(self, metadata: Dict):
"""Update the metadata adding/modifying some keys.
Args:
@@ -1050,7 +1050,7 @@ Source code for minari.dataset.minari_storage
json.dump(saved_metadata, file, default=_json_converter)
@abstractmethod
- def update_episode_metadata(
+ def update_episode_metadata(
self, metadatas: Iterable[Dict], episode_indices: Optional[Iterable] = None
):
"""Update the metadata of episodes.
@@ -1063,7 +1063,7 @@ Source code for minari.dataset.minari_storage
...
@abstractmethod
- def get_episode_metadata(self, episode_indices: Iterable[int]) -> Iterable[Dict]:
+ def get_episode_metadata(self, episode_indices: Iterable[int]) -> Iterable[Dict]:
"""Get the metadata of episodes.
Args:
@@ -1074,7 +1074,7 @@ Source code for minari.dataset.minari_storage
"""
...
- def apply(
+ def apply(
self,
function: Callable[[dict], Any],
episode_indices: Optional[Iterable] = None,
@@ -1095,7 +1095,7 @@ Source code for minari.dataset.minari_storage
return map(function, ep_dicts)
@abstractmethod
- def get_episodes(self, episode_indices: Iterable[int]) -> Iterable[dict]:
+ def get_episodes(self, episode_indices: Iterable[int]) -> Iterable[dict]:
"""Get a list of episodes.
Args:
@@ -1107,7 +1107,7 @@ Source code for minari.dataset.minari_storage
...
@abstractmethod
- def update_episodes(self, episodes: Iterable[EpisodeBuffer]):
+ def update_episodes(self, episodes: Iterable[EpisodeBuffer]):
"""Update episodes in the storage from a list of episode buffer.
Args:
@@ -1117,7 +1117,7 @@ Source code for minari.dataset.minari_storage
"""
...
- def update_from_storage(self, storage: MinariStorage):
+ def update_from_storage(self, storage: MinariStorage):
"""Update the dataset using another MinariStorage.
Args:
@@ -1149,7 +1149,7 @@ Source code for minari.dataset.minari_storage
}
)
- def get_size(self) -> float:
+ def get_size(self) -> float:
"""Returns the dataset size in MB.
Returns:
@@ -1164,33 +1164,33 @@ Source code for minari.dataset.minari_storage
return np.round(datasize, 1)
@property
- def data_path(self) -> pathlib.Path:
+ def data_path(self) -> pathlib.Path:
"""Full path to the dataset."""
return self._data_path
@property
- def total_episodes(self) -> int:
+ def total_episodes(self) -> int:
"""Total episodes in the dataset."""
return self.metadata["total_episodes"]
@property
- def total_steps(self) -> int:
+ def total_steps(self) -> int:
"""Total steps in the dataset."""
return self.metadata["total_steps"]
@property
- def observation_space(self) -> gym.Space:
+ def observation_space(self) -> gym.Space:
"""Observation Space of the dataset."""
return self._observation_space
@property
- def action_space(self) -> gym.Space:
+ def action_space(self) -> gym.Space:
"""Action space of the dataset."""
return self._action_space
-def _json_converter(obj: Any):
+def _json_converter(obj: Any):
if isinstance(obj, set):
return list(obj)
raise TypeError(f"Object of type {type(obj)} is not JSON serializable")
diff --git a/main/_modules/minari/dataset/step_data/index.html b/main/_modules/minari/dataset/step_data/index.html
index 69094f5d..17edaefe 100644
--- a/main/_modules/minari/dataset/step_data/index.html
+++ b/main/_modules/minari/dataset/step_data/index.html
@@ -12,7 +12,7 @@
minari.dataset.step_data - Minari Documentation
-
+
@@ -802,12 +802,12 @@
Source code for minari.dataset.step_data
-from typing import Any, Dict, Optional, SupportsFloat, TypedDict
+from typing import Any, Dict, Optional, SupportsFloat, TypedDict
[docs]
-class StepData(TypedDict):
+class StepData(TypedDict):
"""Object containing data of a single environment step."""
observation: Any
diff --git a/main/_modules/minari/namespace/index.html b/main/_modules/minari/namespace/index.html
index 71139ffb..6d1ffca4 100644
--- a/main/_modules/minari/namespace/index.html
+++ b/main/_modules/minari/namespace/index.html
@@ -12,7 +12,7 @@
minari.namespace - Minari Documentation
-
+
@@ -802,17 +802,17 @@
Source code for minari.namespace
-import copy
-import json
-import os
-import re
-import warnings
-from pathlib import Path
-from typing import Any, Dict, Iterable, List, Optional
+import copy
+import json
+import os
+import re
+import warnings
+from pathlib import Path
+from typing import Any, Dict, Iterable, List, Optional
-from minari.storage import get_dataset_path
-from minari.storage.hosting import get_cloud_storage
-from minari.storage.local import list_non_hidden_dirs
+from minari.storage import get_dataset_path
+from minari.storage.hosting import get_cloud_storage
+from minari.storage.local import list_non_hidden_dirs
NAMESPACE_REGEX = re.compile(r"[-_\w][-_\w/]*[-_\w]+")
@@ -821,7 +821,7 @@ Source code for minari.namespace
[docs]
-def create_namespace(
+def create_namespace(
namespace: str,
description: Optional[str] = None,
**kwargs,
@@ -863,7 +863,7 @@ Source code for minari.namespace
-def update_namespace_metadata(
+def update_namespace_metadata(
namespace: str,
description: Optional[str] = None,
**kwargs,
@@ -892,7 +892,7 @@ Source code for minari.namespace
[docs]
-def get_namespace_metadata(namespace: str) -> Dict[str, Any]:
+def get_namespace_metadata(namespace: str) -> Dict[str, Any]:
"""Load local namespace metadata.
Note: The namespace API is an experimental feature and may change in future releases.
@@ -919,7 +919,7 @@ Source code for minari.namespace
[docs]
-def delete_namespace(namespace: str) -> None:
+def delete_namespace(namespace: str) -> None:
"""Delete local namespace. Only empty namespaces can be deleted.
Note: The namespace API is an experimental feature and may change in future releases.
@@ -952,7 +952,7 @@ Source code for minari.namespace
[docs]
-def list_local_namespaces() -> List[str]:
+def list_local_namespaces() -> List[str]:
"""Get the names of the namespaces in the local database.
Note: The namespace API is an experimental feature and may change in future releases.
@@ -963,7 +963,7 @@ Source code for minari.namespace
datasets_path = get_dataset_path()
namespaces = []
- def recurse_directories(base_path: Path, namespace):
+ def recurse_directories(base_path: Path, namespace):
parent_dir = base_path.joinpath(namespace)
for dir_name in list_non_hidden_dirs(parent_dir):
dir_path = os.path.join(parent_dir, dir_name)
@@ -985,7 +985,7 @@ Source code for minari.namespace
[docs]
-def list_remote_namespaces() -> List[str]:
+def list_remote_namespaces() -> List[str]:
"""Get the names of the namespaces in the remote server.
Note: The namespace API is an experimental feature and may change in future releases.
@@ -1001,7 +1001,7 @@ Source code for minari.namespace
[docs]
-def download_namespace_metadata(namespace: str, overwrite: bool = False) -> None:
+def download_namespace_metadata(namespace: str, overwrite: bool = False) -> None:
"""Download remote namespace to local database.
Note: The namespace API is an experimental feature and may change in future releases.
@@ -1032,7 +1032,7 @@ Source code for minari.namespace
[docs]
-def upload_namespace(namespace: str, token: str) -> None:
+def upload_namespace(namespace: str, token: str) -> None:
"""Upload a local namespace to the remote server.
If you would like to upload a namespace please first get in touch with the Farama team at contact@farama.org.
@@ -1067,7 +1067,7 @@ Source code for minari.namespace
-def namespace_hierarchy(namespace: Optional[str]) -> Iterable[str]:
+def namespace_hierarchy(namespace: Optional[str]) -> Iterable[str]:
"""Get all parent namespaces of a given namespace.
Args:
@@ -1084,7 +1084,7 @@ Source code for minari.namespace
yield os.path.join(*namespace_parts[: i + 1])
-def validate_namespace(namespace: Optional[str]) -> None:
+def validate_namespace(namespace: Optional[str]) -> None:
"""Validate a namespace identifier.
Note: The namespace API is an experimental feature and may change in future releases.
diff --git a/main/_modules/minari/storage/hosting/index.html b/main/_modules/minari/storage/hosting/index.html
index 4ee21332..c95d520e 100644
--- a/main/_modules/minari/storage/hosting/index.html
+++ b/main/_modules/minari/storage/hosting/index.html
@@ -12,7 +12,7 @@
minari.storage.hosting - Minari Documentation
-
+
@@ -802,27 +802,27 @@
Source code for minari.storage.hosting
-from __future__ import annotations
+from __future__ import annotations
-import importlib.metadata
-import os
-import warnings
-from collections import defaultdict
-from concurrent.futures import ThreadPoolExecutor
-from typing import Dict, Optional
+import importlib.metadata
+import os
+import warnings
+from collections import defaultdict
+from concurrent.futures import ThreadPoolExecutor
+from typing import Dict, Optional
-from minari.dataset.minari_dataset import gen_dataset_id, parse_dataset_id
-from minari.dataset.minari_storage import MinariStorage
-from minari.storage.datasets_root_dir import get_dataset_path
-from minari.storage.local import load_dataset
-from minari.storage.remotes import get_cloud_storage
+from minari.dataset.minari_dataset import gen_dataset_id, parse_dataset_id
+from minari.dataset.minari_storage import MinariStorage
+from minari.storage.datasets_root_dir import get_dataset_path
+from minari.storage.local import load_dataset
+from minari.storage.remotes import get_cloud_storage
# Use importlib due to circular import when: "from minari import __version__"
__version__ = importlib.metadata.version("minari")
-def upload_dataset(dataset_id: str, token: str):
+def upload_dataset(dataset_id: str, token: str):
"""Upload a Minari dataset to the remote Farama server.
If you would like to upload a dataset please first get in touch with the Farama team at contact@farama.org.
@@ -833,7 +833,7 @@ Source code for minari.storage.hosting
Notice, that for GCP, this is the path to the service account key file, while for Hugging Face, this is the API token.
"""
# Avoid circular import
- from minari.namespace import list_remote_namespaces, upload_namespace
+ from minari.namespace import list_remote_namespaces, upload_namespace
remote_datasets = list_remote_datasets()
if dataset_id in remote_datasets.keys():
@@ -861,7 +861,7 @@ Source code for minari.storage.hosting
[docs]
-def download_dataset(dataset_id: str, force_download: bool = False):
+def download_dataset(dataset_id: str, force_download: bool = False):
"""Download dataset from remote Farama server.
An error will be raised if the dataset version is not compatible with the local installed version of Minari.
@@ -872,8 +872,8 @@ Source code for minari.storage.hosting
dataset_id (str): name id of the Minari dataset. It can also be a complete remote path, e.g. `hf://farama-minari/D4RL/door/human-v2`.
force_download (bool): boolean flag for force downloading the dataset. Default Value = False
"""
- from minari import supported_dataset_versions
- from minari.namespace import (
+ from minari import supported_dataset_versions
+ from minari.namespace import (
download_namespace_metadata,
list_local_namespaces,
namespace_hierarchy,
@@ -993,7 +993,7 @@ Source code for minari.storage.hosting
[docs]
-def list_remote_datasets(
+def list_remote_datasets(
remote_path: Optional[str] = None,
prefix: Optional[str] = None,
latest_version: bool = False,
@@ -1011,7 +1011,7 @@ Source code for minari.storage.hosting
Returns:
Dict[str, Dict[str, str]]: keys the names of the Minari datasets and values the metadata
"""
- from minari import supported_dataset_versions
+ from minari import supported_dataset_versions
cloud_storage = get_cloud_storage(remote_path=remote_path)
dataset_ids = cloud_storage.list_datasets(prefix=prefix)
diff --git a/main/_modules/minari/storage/local/index.html b/main/_modules/minari/storage/local/index.html
index 428d205a..54f19b02 100644
--- a/main/_modules/minari/storage/local/index.html
+++ b/main/_modules/minari/storage/local/index.html
@@ -12,7 +12,7 @@
minari.storage.local - Minari Documentation
-
+
@@ -802,35 +802,35 @@
Source code for minari.storage.local
-import importlib.metadata
-import os
-import pathlib
-import shutil
-import warnings
-from typing import Dict, Iterable, Optional, Tuple, Union
-
-from minari.dataset.minari_dataset import (
+import importlib.metadata
+import os
+import pathlib
+import shutil
+import warnings
+from typing import Dict, Iterable, Optional, Tuple, Union
+
+from minari.dataset.minari_dataset import (
MinariDataset,
gen_dataset_id,
parse_dataset_id,
)
-from minari.dataset.minari_storage import MinariStorage
-from minari.storage import hosting
-from minari.storage.datasets_root_dir import get_dataset_path
+from minari.dataset.minari_storage import MinariStorage
+from minari.storage import hosting
+from minari.storage.datasets_root_dir import get_dataset_path
# Use importlib due to circular import when: "from minari import __version__"
__version__ = importlib.metadata.version("minari")
-def list_non_hidden_dirs(path: pathlib.Path) -> Iterable[str]:
+def list_non_hidden_dirs(path: pathlib.Path) -> Iterable[str]:
"""List all non-hidden subdirectories."""
for d in path.iterdir():
if d.is_dir() and (not d.name.startswith(".")):
yield d.name
-def dataset_id_sort_key(dataset_id: str) -> Tuple[str, str, int]:
+def dataset_id_sort_key(dataset_id: str) -> Tuple[str, str, int]:
"""Key for sorting dataset ids first by namespace, and then alphabetically."""
namespace, dataset_name, version = parse_dataset_id(dataset_id)
namespace = "" if namespace is None else namespace
@@ -839,7 +839,7 @@ Source code for minari.storage.local
[docs]
-def load_dataset(dataset_id: str, download: bool = False):
+def load_dataset(dataset_id: str, download: bool = False):
"""Retrieve Minari dataset from local database.
Args:
@@ -866,7 +866,7 @@ Source code for minari.storage.local
[docs]
-def list_local_datasets(
+def list_local_datasets(
latest_version: bool = False,
compatible_minari_version: bool = False,
prefix: Optional[str] = None,
@@ -880,12 +880,12 @@ Source code for minari.storage.local
Returns:
Dict[str, Dict[str, str]]: keys the names of the Minari datasets and values the metadata
"""
- from minari import supported_dataset_versions
+ from minari import supported_dataset_versions
datasets_path = get_dataset_path()
dataset_ids = []
- def recurse_directories(base_path: pathlib.Path, namespace):
+ def recurse_directories(base_path: pathlib.Path, namespace):
parent_dir = base_path.joinpath(namespace)
if not parent_dir.exists():
return
@@ -945,7 +945,7 @@ Source code for minari.storage.local
[docs]
-def delete_dataset(dataset_id: str):
+def delete_dataset(dataset_id: str):
"""Delete a Minari dataset from the local Minari database.
Args:
diff --git a/main/_modules/minari/utils/index.html b/main/_modules/minari/utils/index.html
index 87d3d909..ba84c5d8 100644
--- a/main/_modules/minari/utils/index.html
+++ b/main/_modules/minari/utils/index.html
@@ -12,7 +12,7 @@
minari.utils - Minari Documentation
-
+
@@ -802,34 +802,34 @@
Source code for minari.utils
-from __future__ import annotations
+from __future__ import annotations
-import copy
-import importlib.metadata
-import os
-import re
-import warnings
-from typing import Any, Callable, Dict, Iterable, List, Optional
+import copy
+import importlib.metadata
+import os
+import re
+import warnings
+from typing import Any, Callable, Dict, Iterable, List, Optional
-import gymnasium as gym
-import numpy as np
-from gymnasium.core import ActType, ObsType
-from gymnasium.envs.registration import EnvSpec
-from gymnasium.wrappers import RecordEpisodeStatistics # type: ignore
+import gymnasium as gym
+import numpy as np
+from gymnasium.core import ActType, ObsType
+from gymnasium.envs.registration import EnvSpec
+from gymnasium.wrappers import RecordEpisodeStatistics # type: ignore
-from minari.data_collector.episode_buffer import EpisodeBuffer
-from minari.dataset.minari_dataset import MinariDataset, parse_dataset_id
-from minari.dataset.minari_storage import MinariStorage
-from minari.namespace import create_namespace, list_local_namespaces
-from minari.serialization import deserialize_space
-from minari.storage.datasets_root_dir import get_dataset_path
+from minari.data_collector.episode_buffer import EpisodeBuffer
+from minari.dataset.minari_dataset import MinariDataset, parse_dataset_id
+from minari.dataset.minari_storage import MinariStorage
+from minari.namespace import create_namespace, list_local_namespaces
+from minari.serialization import deserialize_space
+from minari.storage.datasets_root_dir import get_dataset_path
# Use importlib due to circular import when: "from minari import __version__"
__version__ = importlib.metadata.version("minari")
-def validate_datasets_to_combine(
+def validate_datasets_to_combine(
datasets_to_combine: List[MinariDataset],
) -> EnvSpec | None:
"""Check if the given datasets can be combined.
@@ -891,22 +891,22 @@ Source code for minari.utils
return common_env_spec
-class RandomPolicy:
+class RandomPolicy:
"""A random action selection policy to compute `ref_min_score`."""
- def __init__(self, env: gym.Env):
+ def __init__(self, env: gym.Env):
self.action_space = env.action_space
self.action_space.seed(123)
self.observation_space = env.observation_space
- def __call__(self, observation: ObsType) -> ActType:
+ def __call__(self, observation: ObsType) -> ActType:
assert self.observation_space.contains(observation)
return self.action_space.sample()
[docs]
-def combine_datasets(datasets_to_combine: List[MinariDataset], new_dataset_id: str):
+def combine_datasets(datasets_to_combine: List[MinariDataset], new_dataset_id: str):
"""Combine a group of MinariDataset in to a single dataset with its own name id.
The new dataset will contain a metadata attribute `combined_datasets` containing a list
@@ -950,7 +950,7 @@ Source code for minari.utils
[docs]
-def split_dataset(
+def split_dataset(
dataset: MinariDataset, sizes: List[int], seed: Optional[int] = None
) -> List[MinariDataset]:
"""Split a MinariDataset in multiple datasets.
@@ -984,7 +984,7 @@ Source code for minari.utils
-def get_average_reference_score(
+def get_average_reference_score(
env: gym.Env,
policy: Callable[[ObsType], ActType],
num_episodes: int,
@@ -1007,7 +1007,7 @@ Source code for minari.utils
return float(mean_ref_score)
-def _generate_dataset_path(dataset_id: str) -> str | os.PathLike:
+def _generate_dataset_path(dataset_id: str) -> str | os.PathLike:
"""Checks if the dataset already exists locally, then create and return the data storage directory."""
dataset_path = get_dataset_path(dataset_id)
if os.path.exists(dataset_path):
@@ -1021,7 +1021,7 @@ Source code for minari.utils
return dataset_path
-def _generate_dataset_metadata(
+def _generate_dataset_metadata(
dataset_id: str,
env_spec: Optional[EnvSpec],
eval_env: Optional[str | gym.Env | EnvSpec],
@@ -1141,7 +1141,7 @@ Source code for minari.utils
[docs]
-def create_dataset_from_buffers(
+def create_dataset_from_buffers(
dataset_id: str,
buffer: List[EpisodeBuffer],
env: Optional[str | gym.Env | EnvSpec] = None,
@@ -1250,7 +1250,7 @@ Source code for minari.utils
[docs]
-def get_normalized_score(dataset: MinariDataset, returns: np.ndarray) -> np.ndarray:
+def get_normalized_score(dataset: MinariDataset, returns: np.ndarray) -> np.ndarray:
r"""Normalize undiscounted return of an episode.
This function was originally provided in the `D4RL repository <https://github.com/Farama-Foundation/D4RL/blob/71a9549f2091accff93eeff68f1f3ab2c0e0a288/d4rl/offline_env.py#L71>`_.
@@ -1283,7 +1283,7 @@ Source code for minari.utils
-def get_env_spec_dict(env_spec: EnvSpec) -> Dict[str, str]:
+def get_env_spec_dict(env_spec: EnvSpec) -> Dict[str, str]:
"""Create dict of the environment specs, including observation and action space."""
try:
env = gym.make(env_spec)
@@ -1316,7 +1316,7 @@ Source code for minari.utils
return {k: str(v) for k, v in md_dict.items()}
-def get_dataset_spec_dict(dataset_spec: Dict) -> Dict[str, str]:
+def get_dataset_spec_dict(dataset_spec: Dict) -> Dict[str, str]:
"""Create dict of the dataset specs, including observation and action space."""
code_link = dataset_spec.get("code_permalink")
action_space = dataset_spec.get("action_space")
@@ -1339,7 +1339,7 @@ Source code for minari.utils
dataset_action_space = action_space.__repr__().replace("\n", "")
md_dict["Dataset Action Space"] = f"`{dataset_action_space}`"
- from minari import supported_dataset_versions
+ from minari import supported_dataset_versions
version = dataset_spec["minari_version"]
supported = (
diff --git a/main/_static/pygments.css b/main/_static/pygments.css
index 02b4b128..f71bfbfc 100644
--- a/main/_static/pygments.css
+++ b/main/_static/pygments.css
@@ -5,83 +5,83 @@
.highlight span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #f8f8f8; }
-.highlight .c { color: #8f5902; font-style: italic } /* Comment */
-.highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */
-.highlight .g { color: #000000 } /* Generic */
-.highlight .k { color: #204a87; font-weight: bold } /* Keyword */
-.highlight .l { color: #000000 } /* Literal */
-.highlight .n { color: #000000 } /* Name */
-.highlight .o { color: #ce5c00; font-weight: bold } /* Operator */
-.highlight .x { color: #000000 } /* Other */
-.highlight .p { color: #000000; font-weight: bold } /* Punctuation */
-.highlight .ch { color: #8f5902; font-style: italic } /* Comment.Hashbang */
-.highlight .cm { color: #8f5902; font-style: italic } /* Comment.Multiline */
-.highlight .cp { color: #8f5902; font-style: italic } /* Comment.Preproc */
-.highlight .cpf { color: #8f5902; font-style: italic } /* Comment.PreprocFile */
-.highlight .c1 { color: #8f5902; font-style: italic } /* Comment.Single */
-.highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */
-.highlight .gd { color: #a40000 } /* Generic.Deleted */
-.highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */
-.highlight .ges { color: #000000; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
-.highlight .gr { color: #ef2929 } /* Generic.Error */
+.highlight .c { color: #8F5902; font-style: italic } /* Comment */
+.highlight .err { color: #A40000; border: 1px solid #EF2929 } /* Error */
+.highlight .g { color: #000 } /* Generic */
+.highlight .k { color: #204A87; font-weight: bold } /* Keyword */
+.highlight .l { color: #000 } /* Literal */
+.highlight .n { color: #000 } /* Name */
+.highlight .o { color: #CE5C00; font-weight: bold } /* Operator */
+.highlight .x { color: #000 } /* Other */
+.highlight .p { color: #000; font-weight: bold } /* Punctuation */
+.highlight .ch { color: #8F5902; font-style: italic } /* Comment.Hashbang */
+.highlight .cm { color: #8F5902; font-style: italic } /* Comment.Multiline */
+.highlight .cp { color: #8F5902; font-style: italic } /* Comment.Preproc */
+.highlight .cpf { color: #8F5902; font-style: italic } /* Comment.PreprocFile */
+.highlight .c1 { color: #8F5902; font-style: italic } /* Comment.Single */
+.highlight .cs { color: #8F5902; font-style: italic } /* Comment.Special */
+.highlight .gd { color: #A40000 } /* Generic.Deleted */
+.highlight .ge { color: #000; font-style: italic } /* Generic.Emph */
+.highlight .ges { color: #000; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
+.highlight .gr { color: #EF2929 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
-.highlight .go { color: #000000; font-style: italic } /* Generic.Output */
-.highlight .gp { color: #8f5902 } /* Generic.Prompt */
-.highlight .gs { color: #000000; font-weight: bold } /* Generic.Strong */
+.highlight .go { color: #000; font-style: italic } /* Generic.Output */
+.highlight .gp { color: #8F5902 } /* Generic.Prompt */
+.highlight .gs { color: #000; font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
-.highlight .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */
-.highlight .kc { color: #204a87; font-weight: bold } /* Keyword.Constant */
-.highlight .kd { color: #204a87; font-weight: bold } /* Keyword.Declaration */
-.highlight .kn { color: #204a87; font-weight: bold } /* Keyword.Namespace */
-.highlight .kp { color: #204a87; font-weight: bold } /* Keyword.Pseudo */
-.highlight .kr { color: #204a87; font-weight: bold } /* Keyword.Reserved */
-.highlight .kt { color: #204a87; font-weight: bold } /* Keyword.Type */
-.highlight .ld { color: #000000 } /* Literal.Date */
-.highlight .m { color: #0000cf; font-weight: bold } /* Literal.Number */
-.highlight .s { color: #4e9a06 } /* Literal.String */
-.highlight .na { color: #c4a000 } /* Name.Attribute */
-.highlight .nb { color: #204a87 } /* Name.Builtin */
-.highlight .nc { color: #000000 } /* Name.Class */
-.highlight .no { color: #000000 } /* Name.Constant */
-.highlight .nd { color: #5c35cc; font-weight: bold } /* Name.Decorator */
-.highlight .ni { color: #ce5c00 } /* Name.Entity */
-.highlight .ne { color: #cc0000; font-weight: bold } /* Name.Exception */
-.highlight .nf { color: #000000 } /* Name.Function */
-.highlight .nl { color: #f57900 } /* Name.Label */
-.highlight .nn { color: #000000 } /* Name.Namespace */
-.highlight .nx { color: #000000 } /* Name.Other */
-.highlight .py { color: #000000 } /* Name.Property */
-.highlight .nt { color: #204a87; font-weight: bold } /* Name.Tag */
-.highlight .nv { color: #000000 } /* Name.Variable */
-.highlight .ow { color: #204a87; font-weight: bold } /* Operator.Word */
-.highlight .pm { color: #000000; font-weight: bold } /* Punctuation.Marker */
-.highlight .w { color: #f8f8f8 } /* Text.Whitespace */
-.highlight .mb { color: #0000cf; font-weight: bold } /* Literal.Number.Bin */
-.highlight .mf { color: #0000cf; font-weight: bold } /* Literal.Number.Float */
-.highlight .mh { color: #0000cf; font-weight: bold } /* Literal.Number.Hex */
-.highlight .mi { color: #0000cf; font-weight: bold } /* Literal.Number.Integer */
-.highlight .mo { color: #0000cf; font-weight: bold } /* Literal.Number.Oct */
-.highlight .sa { color: #4e9a06 } /* Literal.String.Affix */
-.highlight .sb { color: #4e9a06 } /* Literal.String.Backtick */
-.highlight .sc { color: #4e9a06 } /* Literal.String.Char */
-.highlight .dl { color: #4e9a06 } /* Literal.String.Delimiter */
-.highlight .sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */
-.highlight .s2 { color: #4e9a06 } /* Literal.String.Double */
-.highlight .se { color: #4e9a06 } /* Literal.String.Escape */
-.highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */
-.highlight .si { color: #4e9a06 } /* Literal.String.Interpol */
-.highlight .sx { color: #4e9a06 } /* Literal.String.Other */
-.highlight .sr { color: #4e9a06 } /* Literal.String.Regex */
-.highlight .s1 { color: #4e9a06 } /* Literal.String.Single */
-.highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */
-.highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */
-.highlight .fm { color: #000000 } /* Name.Function.Magic */
-.highlight .vc { color: #000000 } /* Name.Variable.Class */
-.highlight .vg { color: #000000 } /* Name.Variable.Global */
-.highlight .vi { color: #000000 } /* Name.Variable.Instance */
-.highlight .vm { color: #000000 } /* Name.Variable.Magic */
-.highlight .il { color: #0000cf; font-weight: bold } /* Literal.Number.Integer.Long */
+.highlight .gt { color: #A40000; font-weight: bold } /* Generic.Traceback */
+.highlight .kc { color: #204A87; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #204A87; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #204A87; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #204A87; font-weight: bold } /* Keyword.Pseudo */
+.highlight .kr { color: #204A87; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #204A87; font-weight: bold } /* Keyword.Type */
+.highlight .ld { color: #000 } /* Literal.Date */
+.highlight .m { color: #0000CF; font-weight: bold } /* Literal.Number */
+.highlight .s { color: #4E9A06 } /* Literal.String */
+.highlight .na { color: #C4A000 } /* Name.Attribute */
+.highlight .nb { color: #204A87 } /* Name.Builtin */
+.highlight .nc { color: #000 } /* Name.Class */
+.highlight .no { color: #000 } /* Name.Constant */
+.highlight .nd { color: #5C35CC; font-weight: bold } /* Name.Decorator */
+.highlight .ni { color: #CE5C00 } /* Name.Entity */
+.highlight .ne { color: #C00; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #000 } /* Name.Function */
+.highlight .nl { color: #F57900 } /* Name.Label */
+.highlight .nn { color: #000 } /* Name.Namespace */
+.highlight .nx { color: #000 } /* Name.Other */
+.highlight .py { color: #000 } /* Name.Property */
+.highlight .nt { color: #204A87; font-weight: bold } /* Name.Tag */
+.highlight .nv { color: #000 } /* Name.Variable */
+.highlight .ow { color: #204A87; font-weight: bold } /* Operator.Word */
+.highlight .pm { color: #000; font-weight: bold } /* Punctuation.Marker */
+.highlight .w { color: #F8F8F8 } /* Text.Whitespace */
+.highlight .mb { color: #0000CF; font-weight: bold } /* Literal.Number.Bin */
+.highlight .mf { color: #0000CF; font-weight: bold } /* Literal.Number.Float */
+.highlight .mh { color: #0000CF; font-weight: bold } /* Literal.Number.Hex */
+.highlight .mi { color: #0000CF; font-weight: bold } /* Literal.Number.Integer */
+.highlight .mo { color: #0000CF; font-weight: bold } /* Literal.Number.Oct */
+.highlight .sa { color: #4E9A06 } /* Literal.String.Affix */
+.highlight .sb { color: #4E9A06 } /* Literal.String.Backtick */
+.highlight .sc { color: #4E9A06 } /* Literal.String.Char */
+.highlight .dl { color: #4E9A06 } /* Literal.String.Delimiter */
+.highlight .sd { color: #8F5902; font-style: italic } /* Literal.String.Doc */
+.highlight .s2 { color: #4E9A06 } /* Literal.String.Double */
+.highlight .se { color: #4E9A06 } /* Literal.String.Escape */
+.highlight .sh { color: #4E9A06 } /* Literal.String.Heredoc */
+.highlight .si { color: #4E9A06 } /* Literal.String.Interpol */
+.highlight .sx { color: #4E9A06 } /* Literal.String.Other */
+.highlight .sr { color: #4E9A06 } /* Literal.String.Regex */
+.highlight .s1 { color: #4E9A06 } /* Literal.String.Single */
+.highlight .ss { color: #4E9A06 } /* Literal.String.Symbol */
+.highlight .bp { color: #3465A4 } /* Name.Builtin.Pseudo */
+.highlight .fm { color: #000 } /* Name.Function.Magic */
+.highlight .vc { color: #000 } /* Name.Variable.Class */
+.highlight .vg { color: #000 } /* Name.Variable.Global */
+.highlight .vi { color: #000 } /* Name.Variable.Instance */
+.highlight .vm { color: #000 } /* Name.Variable.Magic */
+.highlight .il { color: #0000CF; font-weight: bold } /* Literal.Number.Integer.Long */
@media not print {
body[data-theme="dark"] .highlight pre { line-height: 125%; }
body[data-theme="dark"] .highlight td.linenos .normal { color: #aaaaaa; background-color: transparent; padding-left: 5px; padding-right: 5px; }
@@ -89,85 +89,85 @@ body[data-theme="dark"] .highlight span.linenos { color: #aaaaaa; background-col
body[data-theme="dark"] .highlight td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
body[data-theme="dark"] .highlight span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
body[data-theme="dark"] .highlight .hll { background-color: #404040 }
-body[data-theme="dark"] .highlight { background: #202020; color: #d0d0d0 }
-body[data-theme="dark"] .highlight .c { color: #ababab; font-style: italic } /* Comment */
-body[data-theme="dark"] .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
-body[data-theme="dark"] .highlight .esc { color: #d0d0d0 } /* Escape */
-body[data-theme="dark"] .highlight .g { color: #d0d0d0 } /* Generic */
-body[data-theme="dark"] .highlight .k { color: #6ebf26; font-weight: bold } /* Keyword */
-body[data-theme="dark"] .highlight .l { color: #d0d0d0 } /* Literal */
-body[data-theme="dark"] .highlight .n { color: #d0d0d0 } /* Name */
-body[data-theme="dark"] .highlight .o { color: #d0d0d0 } /* Operator */
-body[data-theme="dark"] .highlight .x { color: #d0d0d0 } /* Other */
-body[data-theme="dark"] .highlight .p { color: #d0d0d0 } /* Punctuation */
-body[data-theme="dark"] .highlight .ch { color: #ababab; font-style: italic } /* Comment.Hashbang */
-body[data-theme="dark"] .highlight .cm { color: #ababab; font-style: italic } /* Comment.Multiline */
-body[data-theme="dark"] .highlight .cp { color: #ff3a3a; font-weight: bold } /* Comment.Preproc */
-body[data-theme="dark"] .highlight .cpf { color: #ababab; font-style: italic } /* Comment.PreprocFile */
-body[data-theme="dark"] .highlight .c1 { color: #ababab; font-style: italic } /* Comment.Single */
-body[data-theme="dark"] .highlight .cs { color: #e50808; font-weight: bold; background-color: #520000 } /* Comment.Special */
-body[data-theme="dark"] .highlight .gd { color: #ff3a3a } /* Generic.Deleted */
-body[data-theme="dark"] .highlight .ge { color: #d0d0d0; font-style: italic } /* Generic.Emph */
-body[data-theme="dark"] .highlight .ges { color: #d0d0d0; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
-body[data-theme="dark"] .highlight .gr { color: #ff3a3a } /* Generic.Error */
-body[data-theme="dark"] .highlight .gh { color: #ffffff; font-weight: bold } /* Generic.Heading */
+body[data-theme="dark"] .highlight { background: #202020; color: #D0D0D0 }
+body[data-theme="dark"] .highlight .c { color: #ABABAB; font-style: italic } /* Comment */
+body[data-theme="dark"] .highlight .err { color: #A61717; background-color: #E3D2D2 } /* Error */
+body[data-theme="dark"] .highlight .esc { color: #D0D0D0 } /* Escape */
+body[data-theme="dark"] .highlight .g { color: #D0D0D0 } /* Generic */
+body[data-theme="dark"] .highlight .k { color: #6EBF26; font-weight: bold } /* Keyword */
+body[data-theme="dark"] .highlight .l { color: #D0D0D0 } /* Literal */
+body[data-theme="dark"] .highlight .n { color: #D0D0D0 } /* Name */
+body[data-theme="dark"] .highlight .o { color: #D0D0D0 } /* Operator */
+body[data-theme="dark"] .highlight .x { color: #D0D0D0 } /* Other */
+body[data-theme="dark"] .highlight .p { color: #D0D0D0 } /* Punctuation */
+body[data-theme="dark"] .highlight .ch { color: #ABABAB; font-style: italic } /* Comment.Hashbang */
+body[data-theme="dark"] .highlight .cm { color: #ABABAB; font-style: italic } /* Comment.Multiline */
+body[data-theme="dark"] .highlight .cp { color: #FF3A3A; font-weight: bold } /* Comment.Preproc */
+body[data-theme="dark"] .highlight .cpf { color: #ABABAB; font-style: italic } /* Comment.PreprocFile */
+body[data-theme="dark"] .highlight .c1 { color: #ABABAB; font-style: italic } /* Comment.Single */
+body[data-theme="dark"] .highlight .cs { color: #E50808; font-weight: bold; background-color: #520000 } /* Comment.Special */
+body[data-theme="dark"] .highlight .gd { color: #FF3A3A } /* Generic.Deleted */
+body[data-theme="dark"] .highlight .ge { color: #D0D0D0; font-style: italic } /* Generic.Emph */
+body[data-theme="dark"] .highlight .ges { color: #D0D0D0; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
+body[data-theme="dark"] .highlight .gr { color: #FF3A3A } /* Generic.Error */
+body[data-theme="dark"] .highlight .gh { color: #FFF; font-weight: bold } /* Generic.Heading */
body[data-theme="dark"] .highlight .gi { color: #589819 } /* Generic.Inserted */
-body[data-theme="dark"] .highlight .go { color: #cccccc } /* Generic.Output */
-body[data-theme="dark"] .highlight .gp { color: #aaaaaa } /* Generic.Prompt */
-body[data-theme="dark"] .highlight .gs { color: #d0d0d0; font-weight: bold } /* Generic.Strong */
-body[data-theme="dark"] .highlight .gu { color: #ffffff; text-decoration: underline } /* Generic.Subheading */
-body[data-theme="dark"] .highlight .gt { color: #ff3a3a } /* Generic.Traceback */
-body[data-theme="dark"] .highlight .kc { color: #6ebf26; font-weight: bold } /* Keyword.Constant */
-body[data-theme="dark"] .highlight .kd { color: #6ebf26; font-weight: bold } /* Keyword.Declaration */
-body[data-theme="dark"] .highlight .kn { color: #6ebf26; font-weight: bold } /* Keyword.Namespace */
-body[data-theme="dark"] .highlight .kp { color: #6ebf26 } /* Keyword.Pseudo */
-body[data-theme="dark"] .highlight .kr { color: #6ebf26; font-weight: bold } /* Keyword.Reserved */
-body[data-theme="dark"] .highlight .kt { color: #6ebf26; font-weight: bold } /* Keyword.Type */
-body[data-theme="dark"] .highlight .ld { color: #d0d0d0 } /* Literal.Date */
-body[data-theme="dark"] .highlight .m { color: #51b2fd } /* Literal.Number */
-body[data-theme="dark"] .highlight .s { color: #ed9d13 } /* Literal.String */
-body[data-theme="dark"] .highlight .na { color: #bbbbbb } /* Name.Attribute */
-body[data-theme="dark"] .highlight .nb { color: #2fbccd } /* Name.Builtin */
-body[data-theme="dark"] .highlight .nc { color: #71adff; text-decoration: underline } /* Name.Class */
-body[data-theme="dark"] .highlight .no { color: #40ffff } /* Name.Constant */
-body[data-theme="dark"] .highlight .nd { color: #ffa500 } /* Name.Decorator */
-body[data-theme="dark"] .highlight .ni { color: #d0d0d0 } /* Name.Entity */
-body[data-theme="dark"] .highlight .ne { color: #bbbbbb } /* Name.Exception */
-body[data-theme="dark"] .highlight .nf { color: #71adff } /* Name.Function */
-body[data-theme="dark"] .highlight .nl { color: #d0d0d0 } /* Name.Label */
-body[data-theme="dark"] .highlight .nn { color: #71adff; text-decoration: underline } /* Name.Namespace */
-body[data-theme="dark"] .highlight .nx { color: #d0d0d0 } /* Name.Other */
-body[data-theme="dark"] .highlight .py { color: #d0d0d0 } /* Name.Property */
-body[data-theme="dark"] .highlight .nt { color: #6ebf26; font-weight: bold } /* Name.Tag */
-body[data-theme="dark"] .highlight .nv { color: #40ffff } /* Name.Variable */
-body[data-theme="dark"] .highlight .ow { color: #6ebf26; font-weight: bold } /* Operator.Word */
-body[data-theme="dark"] .highlight .pm { color: #d0d0d0 } /* Punctuation.Marker */
-body[data-theme="dark"] .highlight .w { color: #666666 } /* Text.Whitespace */
-body[data-theme="dark"] .highlight .mb { color: #51b2fd } /* Literal.Number.Bin */
-body[data-theme="dark"] .highlight .mf { color: #51b2fd } /* Literal.Number.Float */
-body[data-theme="dark"] .highlight .mh { color: #51b2fd } /* Literal.Number.Hex */
-body[data-theme="dark"] .highlight .mi { color: #51b2fd } /* Literal.Number.Integer */
-body[data-theme="dark"] .highlight .mo { color: #51b2fd } /* Literal.Number.Oct */
-body[data-theme="dark"] .highlight .sa { color: #ed9d13 } /* Literal.String.Affix */
-body[data-theme="dark"] .highlight .sb { color: #ed9d13 } /* Literal.String.Backtick */
-body[data-theme="dark"] .highlight .sc { color: #ed9d13 } /* Literal.String.Char */
-body[data-theme="dark"] .highlight .dl { color: #ed9d13 } /* Literal.String.Delimiter */
-body[data-theme="dark"] .highlight .sd { color: #ed9d13 } /* Literal.String.Doc */
-body[data-theme="dark"] .highlight .s2 { color: #ed9d13 } /* Literal.String.Double */
-body[data-theme="dark"] .highlight .se { color: #ed9d13 } /* Literal.String.Escape */
-body[data-theme="dark"] .highlight .sh { color: #ed9d13 } /* Literal.String.Heredoc */
-body[data-theme="dark"] .highlight .si { color: #ed9d13 } /* Literal.String.Interpol */
-body[data-theme="dark"] .highlight .sx { color: #ffa500 } /* Literal.String.Other */
-body[data-theme="dark"] .highlight .sr { color: #ed9d13 } /* Literal.String.Regex */
-body[data-theme="dark"] .highlight .s1 { color: #ed9d13 } /* Literal.String.Single */
-body[data-theme="dark"] .highlight .ss { color: #ed9d13 } /* Literal.String.Symbol */
-body[data-theme="dark"] .highlight .bp { color: #2fbccd } /* Name.Builtin.Pseudo */
-body[data-theme="dark"] .highlight .fm { color: #71adff } /* Name.Function.Magic */
-body[data-theme="dark"] .highlight .vc { color: #40ffff } /* Name.Variable.Class */
-body[data-theme="dark"] .highlight .vg { color: #40ffff } /* Name.Variable.Global */
-body[data-theme="dark"] .highlight .vi { color: #40ffff } /* Name.Variable.Instance */
-body[data-theme="dark"] .highlight .vm { color: #40ffff } /* Name.Variable.Magic */
-body[data-theme="dark"] .highlight .il { color: #51b2fd } /* Literal.Number.Integer.Long */
+body[data-theme="dark"] .highlight .go { color: #CCC } /* Generic.Output */
+body[data-theme="dark"] .highlight .gp { color: #AAA } /* Generic.Prompt */
+body[data-theme="dark"] .highlight .gs { color: #D0D0D0; font-weight: bold } /* Generic.Strong */
+body[data-theme="dark"] .highlight .gu { color: #FFF; text-decoration: underline } /* Generic.Subheading */
+body[data-theme="dark"] .highlight .gt { color: #FF3A3A } /* Generic.Traceback */
+body[data-theme="dark"] .highlight .kc { color: #6EBF26; font-weight: bold } /* Keyword.Constant */
+body[data-theme="dark"] .highlight .kd { color: #6EBF26; font-weight: bold } /* Keyword.Declaration */
+body[data-theme="dark"] .highlight .kn { color: #6EBF26; font-weight: bold } /* Keyword.Namespace */
+body[data-theme="dark"] .highlight .kp { color: #6EBF26 } /* Keyword.Pseudo */
+body[data-theme="dark"] .highlight .kr { color: #6EBF26; font-weight: bold } /* Keyword.Reserved */
+body[data-theme="dark"] .highlight .kt { color: #6EBF26; font-weight: bold } /* Keyword.Type */
+body[data-theme="dark"] .highlight .ld { color: #D0D0D0 } /* Literal.Date */
+body[data-theme="dark"] .highlight .m { color: #51B2FD } /* Literal.Number */
+body[data-theme="dark"] .highlight .s { color: #ED9D13 } /* Literal.String */
+body[data-theme="dark"] .highlight .na { color: #BBB } /* Name.Attribute */
+body[data-theme="dark"] .highlight .nb { color: #2FBCCD } /* Name.Builtin */
+body[data-theme="dark"] .highlight .nc { color: #71ADFF; text-decoration: underline } /* Name.Class */
+body[data-theme="dark"] .highlight .no { color: #40FFFF } /* Name.Constant */
+body[data-theme="dark"] .highlight .nd { color: #FFA500 } /* Name.Decorator */
+body[data-theme="dark"] .highlight .ni { color: #D0D0D0 } /* Name.Entity */
+body[data-theme="dark"] .highlight .ne { color: #BBB } /* Name.Exception */
+body[data-theme="dark"] .highlight .nf { color: #71ADFF } /* Name.Function */
+body[data-theme="dark"] .highlight .nl { color: #D0D0D0 } /* Name.Label */
+body[data-theme="dark"] .highlight .nn { color: #71ADFF; text-decoration: underline } /* Name.Namespace */
+body[data-theme="dark"] .highlight .nx { color: #D0D0D0 } /* Name.Other */
+body[data-theme="dark"] .highlight .py { color: #D0D0D0 } /* Name.Property */
+body[data-theme="dark"] .highlight .nt { color: #6EBF26; font-weight: bold } /* Name.Tag */
+body[data-theme="dark"] .highlight .nv { color: #40FFFF } /* Name.Variable */
+body[data-theme="dark"] .highlight .ow { color: #6EBF26; font-weight: bold } /* Operator.Word */
+body[data-theme="dark"] .highlight .pm { color: #D0D0D0 } /* Punctuation.Marker */
+body[data-theme="dark"] .highlight .w { color: #666 } /* Text.Whitespace */
+body[data-theme="dark"] .highlight .mb { color: #51B2FD } /* Literal.Number.Bin */
+body[data-theme="dark"] .highlight .mf { color: #51B2FD } /* Literal.Number.Float */
+body[data-theme="dark"] .highlight .mh { color: #51B2FD } /* Literal.Number.Hex */
+body[data-theme="dark"] .highlight .mi { color: #51B2FD } /* Literal.Number.Integer */
+body[data-theme="dark"] .highlight .mo { color: #51B2FD } /* Literal.Number.Oct */
+body[data-theme="dark"] .highlight .sa { color: #ED9D13 } /* Literal.String.Affix */
+body[data-theme="dark"] .highlight .sb { color: #ED9D13 } /* Literal.String.Backtick */
+body[data-theme="dark"] .highlight .sc { color: #ED9D13 } /* Literal.String.Char */
+body[data-theme="dark"] .highlight .dl { color: #ED9D13 } /* Literal.String.Delimiter */
+body[data-theme="dark"] .highlight .sd { color: #ED9D13 } /* Literal.String.Doc */
+body[data-theme="dark"] .highlight .s2 { color: #ED9D13 } /* Literal.String.Double */
+body[data-theme="dark"] .highlight .se { color: #ED9D13 } /* Literal.String.Escape */
+body[data-theme="dark"] .highlight .sh { color: #ED9D13 } /* Literal.String.Heredoc */
+body[data-theme="dark"] .highlight .si { color: #ED9D13 } /* Literal.String.Interpol */
+body[data-theme="dark"] .highlight .sx { color: #FFA500 } /* Literal.String.Other */
+body[data-theme="dark"] .highlight .sr { color: #ED9D13 } /* Literal.String.Regex */
+body[data-theme="dark"] .highlight .s1 { color: #ED9D13 } /* Literal.String.Single */
+body[data-theme="dark"] .highlight .ss { color: #ED9D13 } /* Literal.String.Symbol */
+body[data-theme="dark"] .highlight .bp { color: #2FBCCD } /* Name.Builtin.Pseudo */
+body[data-theme="dark"] .highlight .fm { color: #71ADFF } /* Name.Function.Magic */
+body[data-theme="dark"] .highlight .vc { color: #40FFFF } /* Name.Variable.Class */
+body[data-theme="dark"] .highlight .vg { color: #40FFFF } /* Name.Variable.Global */
+body[data-theme="dark"] .highlight .vi { color: #40FFFF } /* Name.Variable.Instance */
+body[data-theme="dark"] .highlight .vm { color: #40FFFF } /* Name.Variable.Magic */
+body[data-theme="dark"] .highlight .il { color: #51B2FD } /* Literal.Number.Integer.Long */
@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) .highlight pre { line-height: 125%; }
body:not([data-theme="light"]) .highlight td.linenos .normal { color: #aaaaaa; background-color: transparent; padding-left: 5px; padding-right: 5px; }
@@ -175,84 +175,84 @@ body:not([data-theme="light"]) .highlight span.linenos { color: #aaaaaa; backgro
body:not([data-theme="light"]) .highlight td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
body:not([data-theme="light"]) .highlight span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
body:not([data-theme="light"]) .highlight .hll { background-color: #404040 }
-body:not([data-theme="light"]) .highlight { background: #202020; color: #d0d0d0 }
-body:not([data-theme="light"]) .highlight .c { color: #ababab; font-style: italic } /* Comment */
-body:not([data-theme="light"]) .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
-body:not([data-theme="light"]) .highlight .esc { color: #d0d0d0 } /* Escape */
-body:not([data-theme="light"]) .highlight .g { color: #d0d0d0 } /* Generic */
-body:not([data-theme="light"]) .highlight .k { color: #6ebf26; font-weight: bold } /* Keyword */
-body:not([data-theme="light"]) .highlight .l { color: #d0d0d0 } /* Literal */
-body:not([data-theme="light"]) .highlight .n { color: #d0d0d0 } /* Name */
-body:not([data-theme="light"]) .highlight .o { color: #d0d0d0 } /* Operator */
-body:not([data-theme="light"]) .highlight .x { color: #d0d0d0 } /* Other */
-body:not([data-theme="light"]) .highlight .p { color: #d0d0d0 } /* Punctuation */
-body:not([data-theme="light"]) .highlight .ch { color: #ababab; font-style: italic } /* Comment.Hashbang */
-body:not([data-theme="light"]) .highlight .cm { color: #ababab; font-style: italic } /* Comment.Multiline */
-body:not([data-theme="light"]) .highlight .cp { color: #ff3a3a; font-weight: bold } /* Comment.Preproc */
-body:not([data-theme="light"]) .highlight .cpf { color: #ababab; font-style: italic } /* Comment.PreprocFile */
-body:not([data-theme="light"]) .highlight .c1 { color: #ababab; font-style: italic } /* Comment.Single */
-body:not([data-theme="light"]) .highlight .cs { color: #e50808; font-weight: bold; background-color: #520000 } /* Comment.Special */
-body:not([data-theme="light"]) .highlight .gd { color: #ff3a3a } /* Generic.Deleted */
-body:not([data-theme="light"]) .highlight .ge { color: #d0d0d0; font-style: italic } /* Generic.Emph */
-body:not([data-theme="light"]) .highlight .ges { color: #d0d0d0; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
-body:not([data-theme="light"]) .highlight .gr { color: #ff3a3a } /* Generic.Error */
-body:not([data-theme="light"]) .highlight .gh { color: #ffffff; font-weight: bold } /* Generic.Heading */
+body:not([data-theme="light"]) .highlight { background: #202020; color: #D0D0D0 }
+body:not([data-theme="light"]) .highlight .c { color: #ABABAB; font-style: italic } /* Comment */
+body:not([data-theme="light"]) .highlight .err { color: #A61717; background-color: #E3D2D2 } /* Error */
+body:not([data-theme="light"]) .highlight .esc { color: #D0D0D0 } /* Escape */
+body:not([data-theme="light"]) .highlight .g { color: #D0D0D0 } /* Generic */
+body:not([data-theme="light"]) .highlight .k { color: #6EBF26; font-weight: bold } /* Keyword */
+body:not([data-theme="light"]) .highlight .l { color: #D0D0D0 } /* Literal */
+body:not([data-theme="light"]) .highlight .n { color: #D0D0D0 } /* Name */
+body:not([data-theme="light"]) .highlight .o { color: #D0D0D0 } /* Operator */
+body:not([data-theme="light"]) .highlight .x { color: #D0D0D0 } /* Other */
+body:not([data-theme="light"]) .highlight .p { color: #D0D0D0 } /* Punctuation */
+body:not([data-theme="light"]) .highlight .ch { color: #ABABAB; font-style: italic } /* Comment.Hashbang */
+body:not([data-theme="light"]) .highlight .cm { color: #ABABAB; font-style: italic } /* Comment.Multiline */
+body:not([data-theme="light"]) .highlight .cp { color: #FF3A3A; font-weight: bold } /* Comment.Preproc */
+body:not([data-theme="light"]) .highlight .cpf { color: #ABABAB; font-style: italic } /* Comment.PreprocFile */
+body:not([data-theme="light"]) .highlight .c1 { color: #ABABAB; font-style: italic } /* Comment.Single */
+body:not([data-theme="light"]) .highlight .cs { color: #E50808; font-weight: bold; background-color: #520000 } /* Comment.Special */
+body:not([data-theme="light"]) .highlight .gd { color: #FF3A3A } /* Generic.Deleted */
+body:not([data-theme="light"]) .highlight .ge { color: #D0D0D0; font-style: italic } /* Generic.Emph */
+body:not([data-theme="light"]) .highlight .ges { color: #D0D0D0; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
+body:not([data-theme="light"]) .highlight .gr { color: #FF3A3A } /* Generic.Error */
+body:not([data-theme="light"]) .highlight .gh { color: #FFF; font-weight: bold } /* Generic.Heading */
body:not([data-theme="light"]) .highlight .gi { color: #589819 } /* Generic.Inserted */
-body:not([data-theme="light"]) .highlight .go { color: #cccccc } /* Generic.Output */
-body:not([data-theme="light"]) .highlight .gp { color: #aaaaaa } /* Generic.Prompt */
-body:not([data-theme="light"]) .highlight .gs { color: #d0d0d0; font-weight: bold } /* Generic.Strong */
-body:not([data-theme="light"]) .highlight .gu { color: #ffffff; text-decoration: underline } /* Generic.Subheading */
-body:not([data-theme="light"]) .highlight .gt { color: #ff3a3a } /* Generic.Traceback */
-body:not([data-theme="light"]) .highlight .kc { color: #6ebf26; font-weight: bold } /* Keyword.Constant */
-body:not([data-theme="light"]) .highlight .kd { color: #6ebf26; font-weight: bold } /* Keyword.Declaration */
-body:not([data-theme="light"]) .highlight .kn { color: #6ebf26; font-weight: bold } /* Keyword.Namespace */
-body:not([data-theme="light"]) .highlight .kp { color: #6ebf26 } /* Keyword.Pseudo */
-body:not([data-theme="light"]) .highlight .kr { color: #6ebf26; font-weight: bold } /* Keyword.Reserved */
-body:not([data-theme="light"]) .highlight .kt { color: #6ebf26; font-weight: bold } /* Keyword.Type */
-body:not([data-theme="light"]) .highlight .ld { color: #d0d0d0 } /* Literal.Date */
-body:not([data-theme="light"]) .highlight .m { color: #51b2fd } /* Literal.Number */
-body:not([data-theme="light"]) .highlight .s { color: #ed9d13 } /* Literal.String */
-body:not([data-theme="light"]) .highlight .na { color: #bbbbbb } /* Name.Attribute */
-body:not([data-theme="light"]) .highlight .nb { color: #2fbccd } /* Name.Builtin */
-body:not([data-theme="light"]) .highlight .nc { color: #71adff; text-decoration: underline } /* Name.Class */
-body:not([data-theme="light"]) .highlight .no { color: #40ffff } /* Name.Constant */
-body:not([data-theme="light"]) .highlight .nd { color: #ffa500 } /* Name.Decorator */
-body:not([data-theme="light"]) .highlight .ni { color: #d0d0d0 } /* Name.Entity */
-body:not([data-theme="light"]) .highlight .ne { color: #bbbbbb } /* Name.Exception */
-body:not([data-theme="light"]) .highlight .nf { color: #71adff } /* Name.Function */
-body:not([data-theme="light"]) .highlight .nl { color: #d0d0d0 } /* Name.Label */
-body:not([data-theme="light"]) .highlight .nn { color: #71adff; text-decoration: underline } /* Name.Namespace */
-body:not([data-theme="light"]) .highlight .nx { color: #d0d0d0 } /* Name.Other */
-body:not([data-theme="light"]) .highlight .py { color: #d0d0d0 } /* Name.Property */
-body:not([data-theme="light"]) .highlight .nt { color: #6ebf26; font-weight: bold } /* Name.Tag */
-body:not([data-theme="light"]) .highlight .nv { color: #40ffff } /* Name.Variable */
-body:not([data-theme="light"]) .highlight .ow { color: #6ebf26; font-weight: bold } /* Operator.Word */
-body:not([data-theme="light"]) .highlight .pm { color: #d0d0d0 } /* Punctuation.Marker */
-body:not([data-theme="light"]) .highlight .w { color: #666666 } /* Text.Whitespace */
-body:not([data-theme="light"]) .highlight .mb { color: #51b2fd } /* Literal.Number.Bin */
-body:not([data-theme="light"]) .highlight .mf { color: #51b2fd } /* Literal.Number.Float */
-body:not([data-theme="light"]) .highlight .mh { color: #51b2fd } /* Literal.Number.Hex */
-body:not([data-theme="light"]) .highlight .mi { color: #51b2fd } /* Literal.Number.Integer */
-body:not([data-theme="light"]) .highlight .mo { color: #51b2fd } /* Literal.Number.Oct */
-body:not([data-theme="light"]) .highlight .sa { color: #ed9d13 } /* Literal.String.Affix */
-body:not([data-theme="light"]) .highlight .sb { color: #ed9d13 } /* Literal.String.Backtick */
-body:not([data-theme="light"]) .highlight .sc { color: #ed9d13 } /* Literal.String.Char */
-body:not([data-theme="light"]) .highlight .dl { color: #ed9d13 } /* Literal.String.Delimiter */
-body:not([data-theme="light"]) .highlight .sd { color: #ed9d13 } /* Literal.String.Doc */
-body:not([data-theme="light"]) .highlight .s2 { color: #ed9d13 } /* Literal.String.Double */
-body:not([data-theme="light"]) .highlight .se { color: #ed9d13 } /* Literal.String.Escape */
-body:not([data-theme="light"]) .highlight .sh { color: #ed9d13 } /* Literal.String.Heredoc */
-body:not([data-theme="light"]) .highlight .si { color: #ed9d13 } /* Literal.String.Interpol */
-body:not([data-theme="light"]) .highlight .sx { color: #ffa500 } /* Literal.String.Other */
-body:not([data-theme="light"]) .highlight .sr { color: #ed9d13 } /* Literal.String.Regex */
-body:not([data-theme="light"]) .highlight .s1 { color: #ed9d13 } /* Literal.String.Single */
-body:not([data-theme="light"]) .highlight .ss { color: #ed9d13 } /* Literal.String.Symbol */
-body:not([data-theme="light"]) .highlight .bp { color: #2fbccd } /* Name.Builtin.Pseudo */
-body:not([data-theme="light"]) .highlight .fm { color: #71adff } /* Name.Function.Magic */
-body:not([data-theme="light"]) .highlight .vc { color: #40ffff } /* Name.Variable.Class */
-body:not([data-theme="light"]) .highlight .vg { color: #40ffff } /* Name.Variable.Global */
-body:not([data-theme="light"]) .highlight .vi { color: #40ffff } /* Name.Variable.Instance */
-body:not([data-theme="light"]) .highlight .vm { color: #40ffff } /* Name.Variable.Magic */
-body:not([data-theme="light"]) .highlight .il { color: #51b2fd } /* Literal.Number.Integer.Long */
+body:not([data-theme="light"]) .highlight .go { color: #CCC } /* Generic.Output */
+body:not([data-theme="light"]) .highlight .gp { color: #AAA } /* Generic.Prompt */
+body:not([data-theme="light"]) .highlight .gs { color: #D0D0D0; font-weight: bold } /* Generic.Strong */
+body:not([data-theme="light"]) .highlight .gu { color: #FFF; text-decoration: underline } /* Generic.Subheading */
+body:not([data-theme="light"]) .highlight .gt { color: #FF3A3A } /* Generic.Traceback */
+body:not([data-theme="light"]) .highlight .kc { color: #6EBF26; font-weight: bold } /* Keyword.Constant */
+body:not([data-theme="light"]) .highlight .kd { color: #6EBF26; font-weight: bold } /* Keyword.Declaration */
+body:not([data-theme="light"]) .highlight .kn { color: #6EBF26; font-weight: bold } /* Keyword.Namespace */
+body:not([data-theme="light"]) .highlight .kp { color: #6EBF26 } /* Keyword.Pseudo */
+body:not([data-theme="light"]) .highlight .kr { color: #6EBF26; font-weight: bold } /* Keyword.Reserved */
+body:not([data-theme="light"]) .highlight .kt { color: #6EBF26; font-weight: bold } /* Keyword.Type */
+body:not([data-theme="light"]) .highlight .ld { color: #D0D0D0 } /* Literal.Date */
+body:not([data-theme="light"]) .highlight .m { color: #51B2FD } /* Literal.Number */
+body:not([data-theme="light"]) .highlight .s { color: #ED9D13 } /* Literal.String */
+body:not([data-theme="light"]) .highlight .na { color: #BBB } /* Name.Attribute */
+body:not([data-theme="light"]) .highlight .nb { color: #2FBCCD } /* Name.Builtin */
+body:not([data-theme="light"]) .highlight .nc { color: #71ADFF; text-decoration: underline } /* Name.Class */
+body:not([data-theme="light"]) .highlight .no { color: #40FFFF } /* Name.Constant */
+body:not([data-theme="light"]) .highlight .nd { color: #FFA500 } /* Name.Decorator */
+body:not([data-theme="light"]) .highlight .ni { color: #D0D0D0 } /* Name.Entity */
+body:not([data-theme="light"]) .highlight .ne { color: #BBB } /* Name.Exception */
+body:not([data-theme="light"]) .highlight .nf { color: #71ADFF } /* Name.Function */
+body:not([data-theme="light"]) .highlight .nl { color: #D0D0D0 } /* Name.Label */
+body:not([data-theme="light"]) .highlight .nn { color: #71ADFF; text-decoration: underline } /* Name.Namespace */
+body:not([data-theme="light"]) .highlight .nx { color: #D0D0D0 } /* Name.Other */
+body:not([data-theme="light"]) .highlight .py { color: #D0D0D0 } /* Name.Property */
+body:not([data-theme="light"]) .highlight .nt { color: #6EBF26; font-weight: bold } /* Name.Tag */
+body:not([data-theme="light"]) .highlight .nv { color: #40FFFF } /* Name.Variable */
+body:not([data-theme="light"]) .highlight .ow { color: #6EBF26; font-weight: bold } /* Operator.Word */
+body:not([data-theme="light"]) .highlight .pm { color: #D0D0D0 } /* Punctuation.Marker */
+body:not([data-theme="light"]) .highlight .w { color: #666 } /* Text.Whitespace */
+body:not([data-theme="light"]) .highlight .mb { color: #51B2FD } /* Literal.Number.Bin */
+body:not([data-theme="light"]) .highlight .mf { color: #51B2FD } /* Literal.Number.Float */
+body:not([data-theme="light"]) .highlight .mh { color: #51B2FD } /* Literal.Number.Hex */
+body:not([data-theme="light"]) .highlight .mi { color: #51B2FD } /* Literal.Number.Integer */
+body:not([data-theme="light"]) .highlight .mo { color: #51B2FD } /* Literal.Number.Oct */
+body:not([data-theme="light"]) .highlight .sa { color: #ED9D13 } /* Literal.String.Affix */
+body:not([data-theme="light"]) .highlight .sb { color: #ED9D13 } /* Literal.String.Backtick */
+body:not([data-theme="light"]) .highlight .sc { color: #ED9D13 } /* Literal.String.Char */
+body:not([data-theme="light"]) .highlight .dl { color: #ED9D13 } /* Literal.String.Delimiter */
+body:not([data-theme="light"]) .highlight .sd { color: #ED9D13 } /* Literal.String.Doc */
+body:not([data-theme="light"]) .highlight .s2 { color: #ED9D13 } /* Literal.String.Double */
+body:not([data-theme="light"]) .highlight .se { color: #ED9D13 } /* Literal.String.Escape */
+body:not([data-theme="light"]) .highlight .sh { color: #ED9D13 } /* Literal.String.Heredoc */
+body:not([data-theme="light"]) .highlight .si { color: #ED9D13 } /* Literal.String.Interpol */
+body:not([data-theme="light"]) .highlight .sx { color: #FFA500 } /* Literal.String.Other */
+body:not([data-theme="light"]) .highlight .sr { color: #ED9D13 } /* Literal.String.Regex */
+body:not([data-theme="light"]) .highlight .s1 { color: #ED9D13 } /* Literal.String.Single */
+body:not([data-theme="light"]) .highlight .ss { color: #ED9D13 } /* Literal.String.Symbol */
+body:not([data-theme="light"]) .highlight .bp { color: #2FBCCD } /* Name.Builtin.Pseudo */
+body:not([data-theme="light"]) .highlight .fm { color: #71ADFF } /* Name.Function.Magic */
+body:not([data-theme="light"]) .highlight .vc { color: #40FFFF } /* Name.Variable.Class */
+body:not([data-theme="light"]) .highlight .vg { color: #40FFFF } /* Name.Variable.Global */
+body:not([data-theme="light"]) .highlight .vi { color: #40FFFF } /* Name.Variable.Instance */
+body:not([data-theme="light"]) .highlight .vm { color: #40FFFF } /* Name.Variable.Magic */
+body:not([data-theme="light"]) .highlight .il { color: #51B2FD } /* Literal.Number.Integer.Long */
}
}
\ No newline at end of file
diff --git a/main/api/data_collector/episode_buffer/index.html b/main/api/data_collector/episode_buffer/index.html
index 8ad6b5c0..708e48c3 100644
--- a/main/api/data_collector/episode_buffer/index.html
+++ b/main/api/data_collector/episode_buffer/index.html
@@ -13,7 +13,7 @@
EpisodeBuffer - Minari Documentation
-
+
diff --git a/main/api/data_collector/episode_metadata_callback/index.html b/main/api/data_collector/episode_metadata_callback/index.html
index 38dc29f4..66fc8103 100644
--- a/main/api/data_collector/episode_metadata_callback/index.html
+++ b/main/api/data_collector/episode_metadata_callback/index.html
@@ -13,7 +13,7 @@
EpisodeMetadataCallback - Minari Documentation
-
+
diff --git a/main/api/data_collector/index.html b/main/api/data_collector/index.html
index dd2424f4..a9a9e132 100644
--- a/main/api/data_collector/index.html
+++ b/main/api/data_collector/index.html
@@ -13,7 +13,7 @@
DataCollector - Minari Documentation
-
+
@@ -823,8 +823,8 @@ minari.DataCollectorGymnasium environment wrapper that collects step data.
This wrapper is meant to work as a temporary buffer of the environment data before creating a Minari dataset. The creation of the buffers
that will be convert to a Minari dataset is agnostic to the user:
-import minari
-import gymnasium as gym
+import minari
+import gymnasium as gym
env = minari.DataCollector(gym.make('EnvID'))
diff --git a/main/api/data_collector/step_data_callback/index.html b/main/api/data_collector/step_data_callback/index.html
index 4040a92b..3ded099d 100644
--- a/main/api/data_collector/step_data_callback/index.html
+++ b/main/api/data_collector/step_data_callback/index.html
@@ -13,7 +13,7 @@
StepDataCallback - Minari Documentation
-
+
@@ -832,8 +832,8 @@ Methods¶
The input arguments belong to a Gymnasium stepping transition: obs, rew, terminated, truncated, info = env.step(action).
Override this method to add additional keys or edit each environment’s step returns. Additional nested dictionaries can be added to the returned step dictionary
as follows:
-class CustomStepDataCallback(StepDataCallback):
- def __call__(self, env, **kwargs):
+class CustomStepDataCallback(StepDataCallback):
+ def __call__(self, env, **kwargs):
step_data = super().__call__(env, **kwargs)
step_data['environment_states'] = {}
step_data['environment_states']['pose'] = {}
diff --git a/main/api/minari_dataset/episode_data/index.html b/main/api/minari_dataset/episode_data/index.html
index cbfe7937..c2aed7d0 100644
--- a/main/api/minari_dataset/episode_data/index.html
+++ b/main/api/minari_dataset/episode_data/index.html
@@ -13,7 +13,7 @@
EpisodeData - Minari Documentation
-
+
diff --git a/main/api/minari_dataset/minari_dataset/index.html b/main/api/minari_dataset/minari_dataset/index.html
index a19303ee..148fd2c4 100644
--- a/main/api/minari_dataset/minari_dataset/index.html
+++ b/main/api/minari_dataset/minari_dataset/index.html
@@ -13,7 +13,7 @@
MinariDataset - Minari Documentation
-
+
diff --git a/main/api/minari_dataset/minari_storage/index.html b/main/api/minari_dataset/minari_storage/index.html
index 4a973ee7..26bb9128 100644
--- a/main/api/minari_dataset/minari_storage/index.html
+++ b/main/api/minari_dataset/minari_storage/index.html
@@ -13,7 +13,7 @@
MinariStorage - Minari Documentation
-
+
diff --git a/main/api/minari_dataset/step_data/index.html b/main/api/minari_dataset/step_data/index.html
index f7640cf4..3a73982d 100644
--- a/main/api/minari_dataset/step_data/index.html
+++ b/main/api/minari_dataset/step_data/index.html
@@ -13,7 +13,7 @@
StepData - Minari Documentation
-
+
diff --git a/main/api/minari_functions/index.html b/main/api/minari_functions/index.html
index e0ee6571..dac704a0 100644
--- a/main/api/minari_functions/index.html
+++ b/main/api/minari_functions/index.html
@@ -13,7 +13,7 @@
Minari - Minari Documentation
-
+
diff --git a/main/api/namespace/namespace/index.html b/main/api/namespace/namespace/index.html
index 77cb9f36..3a136d2b 100644
--- a/main/api/namespace/namespace/index.html
+++ b/main/api/namespace/namespace/index.html
@@ -13,7 +13,7 @@
Namespace - Minari Documentation
-
+
diff --git a/main/content/basic_usage/index.html b/main/content/basic_usage/index.html
index e19d53af..014efb78 100644
--- a/main/content/basic_usage/index.html
+++ b/main/content/basic_usage/index.html
@@ -13,7 +13,7 @@
Basic Usage - Minari Documentation
-
+
@@ -879,7 +879,7 @@ Load Local Datasetsminari.MinariDataset
object using the minari.load_dataset()
Python function as follows:
-import minari
+import minari
dataset = minari.load_dataset('D4RL/door/human-v2')
print("Observation space:", dataset.observation_space)
print("Action space:", dataset.action_space)
@@ -897,7 +897,7 @@ Load Local Datasets
Sampling Episodes¶
Minari can retrieve a certain amount of episode shards from the dataset files as a list of minari.EpisodeData
objects. The sampling process of the Minari datasets is performed through the method minari.MinariDataset.sample_episodes()
. This method is a generator that randomly samples n
number of minari.EpisodeData
from the minari.MinariDataset
. The seed of this generator can be set with minari.MinariDataset.set_seed()
. For example:
-import minari
+import minari
dataset = minari.load_dataset("D4RL/door/human-v2")
dataset.set_seed(seed=123)
@@ -921,7 +921,7 @@ Sampling Episodesminari.MinariDataset.sample_episodes()
calls.
Minari doesn’t serve the purpose of creating replay buffers out of the Minari datasets, we leave this task for the user to make for their specific needs.
To create your own buffers and dataloaders, you may need the ability to iterate through an episodes in a deterministic order. This can be achieved with minari.MinariDataset.iterate_episodes()
. This method is a generator that iterates over minari.EpisodeData
episodes from minari.MinariDataset
. Specific indices can be also provided. For example:
-import minari
+import minari
dataset = minari.load_dataset("D4RL/door/human-v2")
episodes_generator = dataset.iterate_episodes(episode_indices=[1, 2, 0])
@@ -937,7 +937,7 @@ Sampling Episodesminari.MinariDataset
dataset itself is iterable:.
-import minari
+import minari
dataset = minari.load_dataset("D4RL/door/human-v2")
@@ -948,7 +948,7 @@ Sampling Episodes
Filter Episodes¶
The episodes in the dataset can be filtered before sampling. This is done with a custom conditional callable passed to minari.MinariDataset.filter_episodes()
. The input to the conditional callable is an minari.EpisodeData
and the return value must be True
if you want to keep the episode or False
otherwise. The method will return a new minari.MinariDataset
:
-import minari
+import minari
dataset = minari.load_dataset("D4RL/door/human-v2")
@@ -969,7 +969,7 @@ Filter Episodes
Split Dataset¶
Minari provides another utility function to divide a dataset into multiple datasets, minari.split_dataset()
-import minari
+