{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Example usage\n", "\n", "To use `sc2_datasets` in a project:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Extracting unpack: 100%|██████████| 1/1 [00:00<00:00, 200.00it/s]\n", "Extracting 2022_TestReplaypack: 100%|██████████| 1/1 [00:00<00:00, 333.36it/s]\n" ] } ], "source": [ "from sc2_datasets.available_replaypacks import EXAMPLE_SYNTHETIC_REPLAYPACKS\n", "from sc2_datasets.torch.sc2_egset_dataset import SC2EGSetDataset\n", "\n", "# Initialize the dataset:\n", "sc2_egset_dataset = SC2EGSetDataset(\n", " unpack_dir=\"../tests/test_output/unpack\", # Specify existing directory path, where the data will be unpacked.\n", " download_dir=\"../tests/test_output/download\", # Specify existing directory path, where the data will be downloaded.\n", " download=True,\n", " names_urls=EXAMPLE_SYNTHETIC_REPLAYPACKS, # Use a synthetic replaypack containing 1 replay.\n", ")\n", "\n", "# Iterate over instances:\n", "for i in range(len(sc2_egset_dataset)):\n", " sc2_egset_dataset[i]" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.10.0 ('venv': venv)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.0" }, "vscode": { "interpreter": { "hash": "ddabeebea1640b0163a92815eef996f97fed6bbf3bb1d5b76776c493c09f748f" } } }, "nbformat": 4, "nbformat_minor": 4 }