sc2_datasets.torch.datasets.sc2_replaypack_dataset ================================================== .. py:module:: sc2_datasets.torch.datasets.sc2_replaypack_dataset Classes ------- .. autoapisummary:: sc2_datasets.torch.datasets.sc2_replaypack_dataset.SC2ReplaypackDatasetSingleJSON sc2_datasets.torch.datasets.sc2_replaypack_dataset.SC2ReplaypackDataset Module Contents --------------- .. py:class:: SC2ReplaypackDatasetSingleJSON Bases: :py:obj:`torch.utils.data.Dataset` .. py:class:: SC2ReplaypackDataset(replaypack_name: str, unpack_dir: pathlib.Path | str, download_dir: pathlib.Path | str = Path(''), url: str = '', download: bool = False, unpack_n_workers: int = 16, transform: None | Callable = None, validator: None | Callable = None) Bases: :py:obj:`torch.utils.data.Dataset` Represents a Dataset for a single pre-processed replaypack. :param replaypack_name: Specifies the name of a replaypack. This can be a name of the tournament or any other arbitrary name. :type replaypack_name: str :param unpack_dir: Specifies the directory where the archive will be extracted. :type unpack_dir: Path :param download_dir: Specifies the directory where the initial archive will be downloaded. :type download_dir: Path :param url: Specifies the URL which will be used to download the .zip archive, defaults to "". :type url: str, optional :param download: Specifies if the dataset should be downloaded or if it is pre-downloaded and extracted, defaults to False. :type download: bool, optional :param unpack_n_workers: Specifies the number of workers that will be used for unpacking the archive, defaults to 16. :type unpack_n_workers: int, optional :param validator: Specifies a validator for input data, defaults to None. :type validator: Callable | dict, optional .. py:attribute:: transform :value: None .. py:attribute:: unpack_n_workers :value: 16 .. py:attribute:: download_dir .. py:attribute:: maybe_downloaded_zip_path .. py:attribute:: was_downloaded :value: False .. py:attribute:: unpack_dir .. py:attribute:: replaypack_name .. py:attribute:: url :value: '' .. py:attribute:: replaypack_unpack_path .. py:attribute:: skip_files .. py:attribute:: list_of_files :value: [] .. py:attribute:: len :value: 0 .. py:method:: __len__() -> int .. py:method:: __getitem__(index: int) -> sc2_datasets.replay_data.sc2_replay_data.SC2ReplayData Exposes logic of getting a single parsed item from the replaypack. :param index: Specifies the index of a file that will be parsed and loaded into memory. :type index: int :returns: Returns a parsed SC2ReplayData representation of a StarCraft 2 replay. :rtype: SC2ReplayData .. py:method:: from_args(args: dict[str, Any]) -> SC2ReplaypackDataset :staticmethod: Creates a SC2ReplaypackDataset object from a dictionary of arguments. :param args: Specifies the dictionary of arguments that will be used to initialize the dataset. :type args: dict[str, Any] :returns: Returns a SC2ReplaypackDataset object initialized with the provided arguments. :rtype: SC2ReplaypackDataset .. py:property:: replaypack_summary :type: dict[str, Any] .. py:property:: replaypack_dir_mapping :type: dict[str, str] .. py:property:: replaypack_processed_failed :type: dict[str, list[str]]