diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/genotypes/preprocess_csv_collect_info.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/genotypes/preprocess_csv_collect_info.py b/scripts/genotypes/preprocess_csv_collect_info.py index b153279..6b3b574 100644 --- a/scripts/genotypes/preprocess_csv_collect_info.py +++ b/scripts/genotypes/preprocess_csv_collect_info.py @@ -6,7 +6,7 @@ import logging import multiprocessing as mproc from pathlib import Path from dataclasses import asdict, dataclass, field, fields -from typing import Union, Iterable, Iterator, Optional, Callable +from typing import Union, Iterable, Iterator, Optional, Callable, Sequence from argparse import Namespace, ArgumentParser from gn_libs.cli import SysExit @@ -209,7 +209,7 @@ class _ChunkStats:# pylint: disable=[too-many-instance-attributes] def _accumulate( headers: tuple[str, ...], fileconfigs: dict, - lines: Iterator[str] + lines: Iterable[str] ) -> _ChunkStats: """Accumulate statistics from the provided lines.""" is_skippable_line = _make_is_skippable_line(fileconfigs, headers) @@ -292,7 +292,7 @@ def _merge_all_chunk_stats( def _read_chunks( - lines: Iterator[str], + lines: Iterable[str], chunk_size: int ) -> Iterator[list[str]]: """Group the lines into chunks of at most ``chunk_size`` lines.""" @@ -319,7 +319,7 @@ def _process_chunk(args: tuple[tuple[str, ...], dict, list[str]]) -> _ChunkStats def file_stats_multiprocessing( fileconfigs: dict, headers: tuple[str, ...], - lines: Iterator[str], + lines: Iterable[str], chunk_size: int = MULTIPROCESSING_CHUNK_SIZE ) -> FileStats: """File stats from the lines in the file using multiple processes.""" @@ -338,7 +338,7 @@ def file_stats_multiprocessing( def _as_file_stats( stats: _ChunkStats, - samples: tuple[str, ...], + samples: Sequence[str], header_errors: tuple[LineError, ...] ) -> FileStats: """Convert accumulated statistics into file statistics.""" @@ -385,7 +385,7 @@ def parse_dot_geno_line(line) -> dict[str, str]: def file_stats_singlethread( fileconfigs: dict, headers: tuple[str, ...], - lines: Iterator[str] + lines: Iterable[str] ) -> FileStats: """File stats from the lines in the file using a single-threaded process.""" logger.debug("THE FILE HEADERS: %s", headers) |
