sc2_datasets.validators.validate_chunk ====================================== .. py:module:: sc2_datasets.validators.validate_chunk Functions --------- .. autoapisummary:: sc2_datasets.validators.validate_chunk.validate_chunk Module Contents --------------- .. py:function:: validate_chunk(list_of_replays: list[pathlib.Path]) -> list[tuple[pathlib.Path, bool]] Attempts to parse a chunk of replays and validates the JSON structure using SC2ReplayData parser. :param list_of_replays: Specifies the list of replays that will be validated. :type list_of_replays: list[Path] :returns: Returns a tuple of a filepath and a boolean denoting if the file should be skipped in final processing. :rtype: list[tuple[Path, bool]] .. rubric:: Examples Validate chunk is defined as a smallest piece of code that is used to build up validators. This function is especially relevant when working with multiprocessing. >>> from pathlib import Path >>> validated_chunk = validate_chunk( ... list_of_replays=[ ... Path("./test/test_files/single_replay/test_replay.json"), ... Path("./test/test_files/single_replay/test_bit_flip_example.json"), ... ], ... ) >>> assert len(validated_chunk) == 2 >>> assert validated_chunk[0][1] is True >>> assert validated_chunk[1][1] is False