about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi <fredmanglis@gmail.com>2026-09-28 12:20:20 -0500
committerFrederick Muriuki Muriithi <fredmanglis@gmail.com>2026-09-28 12:20:20 -0500
commitc30c0924eaa5ddbb3d7fecc4c238acd832d8dd3a (patch)
treede8fc8d5f6e515f539c3fcff655f11e4cf57ba3d /scripts
parent750398b0814af3853130f3f9943b02029f59360c (diff)
downloadgn-uploader-c30c0924eaa5ddbb3d7fecc4c238acd832d8dd3a.tar.gz
Add function to read file contents.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/genotypes/preprocess_csv_collect_info.py7
1 files changed, 7 insertions, 0 deletions
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]