From c30c0924eaa5ddbb3d7fecc4c238acd832d8dd3a Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 28 Sep 2026 12:20:20 -0500 Subject: Add function to read file contents. --- scripts/genotypes/preprocess_csv_collect_info.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/genotypes') diff --git a/scripts/genotypes/preprocess_csv_collect_info.py b/scripts/genotypes/preprocess_csv_collect_info.py index f5d3418..a6671ff 100644 --- a/scripts/genotypes/preprocess_csv_collect_info.py +++ b/scripts/genotypes/preprocess_csv_collect_info.py @@ -17,6 +17,13 @@ from .types import FileStats, LineDetails, DotGenoFields, FieldsIdentity logger = logging.getLogger(__name__) +def filecontents(path: Path) -> Iterator[str]: + """Return an iterator to the file contents""" + with path.open("r") as fl: + for line in fl.readlines(): + yield line + + def identify_columns( fields: tuple[str, ...], settings: dict[str, str] -- cgit 1.4.1