Open vincent-octo opened 5 months ago
Suggestions
Use pathlib instead of os.path.
pathlib
os.path
Replacing os.path.join():
os.path.join()
os.path.join(dir_path, "test", "raw_data_test.txt")
becomes
dir_path / "test" / "raw_data_test.txt"
Using type=Path in argparse:
type=Path
parser.add_argument("--out", type=str)
from pathlib import Path parser.add_argument("--out", type=Path)
Be consistent about formatting code.
In the current code there is sometimes 0, or 1, or 2 whitespaces in function calls:
https://github.com/FINNGEN/kanta_lab_preprocessing/blob/6eef71523f9f9b424751cdce0a073a802b05d435/finngen_qc/main.py#L91
Sometimes no new line: https://github.com/FINNGEN/kanta_lab_preprocessing/blob/6eef71523f9f9b424751cdce0a073a802b05d435/finngen_qc/main.py#L120 and sometimes yes new line: https://github.com/FINNGEN/kanta_lab_preprocessing/blob/6eef71523f9f9b424751cdce0a073a802b05d435/finngen_qc/main.py#L124-L125
Could use a code formatter to automatically and consistently fix this (e.g. ruff)
Suggestions
Use
pathlib
instead ofos.path
.Replacing
os.path.join()
:becomes
Using
type=Path
in argparse:becomes
Be consistent about formatting code.
In the current code there is sometimes 0, or 1, or 2 whitespaces in function calls:
https://github.com/FINNGEN/kanta_lab_preprocessing/blob/6eef71523f9f9b424751cdce0a073a802b05d435/finngen_qc/main.py#L91
Sometimes no new line: https://github.com/FINNGEN/kanta_lab_preprocessing/blob/6eef71523f9f9b424751cdce0a073a802b05d435/finngen_qc/main.py#L120 and sometimes yes new line: https://github.com/FINNGEN/kanta_lab_preprocessing/blob/6eef71523f9f9b424751cdce0a073a802b05d435/finngen_qc/main.py#L124-L125
Could use a code formatter to automatically and consistently fix this (e.g. ruff)