Skip to content

Commit

Permalink
fix(sc2_replaypack_processor): fixing maps directory as arg
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaszanas committed Mar 2, 2025
1 parent 833fd0a commit 87b7db3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,11 @@ def main(
output_path.mkdir(exist_ok=True)

# Pre-processing, downloading maps and flattening directories:
map_downloader_args = ReplaypackProcessorArguments(
logging.info("Downloading maps...")
sc2infoextractorgo_map_download(
input_path=replaypacks_input_path,
output_path=output_path,
maps_directory=maps_path,
n_processes=n_processes,
)
logging.info("Downloading maps...")
sc2infoextractorgo_map_download(arguments=map_downloader_args)

# Main processing
sc2egset_processor_args = ReplaypackProcessorArguments(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import logging
from pathlib import Path
from datasetpreparator.sc2.sc2egset_replaypack_processor.utils.multiprocess import (
pre_process_download_maps,
)
from datasetpreparator.sc2.sc2egset_replaypack_processor.utils.replaypack_processor_args import (
ReplaypackProcessorArguments,
SC2InfoExtractorGoArguments,
)


def sc2infoextractorgo_map_download(arguments: ReplaypackProcessorArguments):
def sc2infoextractorgo_map_download(
input_path: Path,
maps_directory: Path,
) -> None:
# Pre-process, download all maps:
logging.info("Downloading all maps...")
map_download_arguments = SC2InfoExtractorGoArguments.get_download_maps_args(
processing_input=arguments.input_path, output=arguments.output_path
processing_input=input_path,
maps_directory=maps_directory,
)
pre_process_download_maps(arguments=map_download_arguments)
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def pre_process_download_maps(arguments: SC2InfoExtractorGoArguments) -> None:
[
str(PATH_TO_SC2INFOEXTRACTORGO),
f"-input={arguments.processing_input}/",
f"-output={arguments.output}/",
f"-maps_directory={arguments.maps_directory}/",
"-only_map_download=true",
f"-max_procs={arguments.max_procs}",
f"-log_level={arguments.log_level}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ def __init__(

@staticmethod
def get_download_maps_args(
processing_input: Path, output: Path
processing_input: Path, maps_directory: Path
) -> "SC2InfoExtractorGoArguments":
arguments = SC2InfoExtractorGoArguments(
processing_input=processing_input,
output=output,
maps_directory=maps_directory,
only_map_download=True,
max_procs=4,
)
Expand Down

0 comments on commit 87b7db3

Please sign in to comment.