diff options
author | Frederick Muriuki Muriithi | 2024-02-05 12:11:43 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-02-05 12:11:43 +0300 |
commit | 949ea71eb721a3f5bdff3ba10f7dd7c70899d560 (patch) | |
tree | 5ea0674953489ce83ffa11c2b689d3c8e31ebede /r_qtl | |
parent | ab71b34b97f3f1eee52b5688f41644541535f281 (diff) | |
download | gn-uploader-949ea71eb721a3f5bdff3ba10f7dd7c70899d560.tar.gz |
Fix linting and type errors.
Diffstat (limited to 'r_qtl')
-rw-r--r-- | r_qtl/r_qtl2_qc.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/r_qtl/r_qtl2_qc.py b/r_qtl/r_qtl2_qc.py index 261d300..853c34b 100644 --- a/r_qtl/r_qtl2_qc.py +++ b/r_qtl/r_qtl2_qc.py @@ -7,23 +7,23 @@ from r_qtl import errors as rqe from r_qtl import r_qtl2 as rqtl2 from r_qtl.r_qtl2 import __FILE_TYPES__ -def bundle_files_list(zfile, cdata: dict) -> tuple[str]: +def bundle_files_list(cdata: dict) -> tuple[str, ...]: """Retrieve files listed in control file.""" def __merge__(alist: tuple[str, ...], member: Union[str, Sequence[str]]) -> tuple[str, ...]: if isinstance(cdata[member], str): return alist + (cdata[member],) return alist + tuple(cdata[member]) - fileslist = tuple() - fileslist = reduce(__merge__, - (key for key in cdata.keys() if key in __FILE_TYPES__), - tuple()) + fileslist: tuple[str, ...] = reduce( + __merge__, + (key for key in cdata.keys() if key in __FILE_TYPES__), + tuple()) if "file" in cdata.get("sex", {}): sexfile = cdata["sex"]["file"] fileslist = fileslist + ( (sexfile,) if isinstance(sexfile, str) else tuple(sexfile)) - + if "file" in cdata.get("cross_info", {}): crossinfofile = cdata["cross_info"]["file"] fileslist = fileslist + ( @@ -32,7 +32,7 @@ def bundle_files_list(zfile, cdata: dict) -> tuple[str]: return fileslist -def missing_files(zfile: ZipFile) -> tuple[str]: +def missing_files(zfile: ZipFile) -> tuple[str, ...]: """ Retrieve a list of files listed in the control file that do not exist in the bundle. @@ -45,7 +45,7 @@ def missing_files(zfile: ZipFile) -> tuple[str]: return True return tuple(filter(__missing_p__, - bundle_files_list(zfile, rqtl2.control_data(zfile)))) + bundle_files_list(rqtl2.control_data(zfile)))) def validate_bundle(zfile: ZipFile): """Ensure the R/qtl2 bundle is valid.""" |