Skip to content

Commit

Permalink
Merge pull request #136 from hplt-project/dataset-refactor
Browse files Browse the repository at this point in the history
tiny refactor in opuscleaner.datasets
  • Loading branch information
jelmervdl authored Jan 7, 2024
2 parents c13aed6 + ddc2a51 commit 0922271
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions opuscleaner/datasets.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env python3
"""Lists datasets given a directory. It works by scanning the directory and looking for gz files."""
import os
from functools import wraps
from glob import glob
from itertools import groupby
from pathlib import Path as Path
from typing import Iterable, Dict, List, Tuple
from typing import Dict, List, Tuple

from opuscleaner.config import DATA_PATH


def list_datasets(path:str) -> Dict[str,List[Tuple[str,Path]]]:
Expand Down Expand Up @@ -42,7 +42,10 @@ def list_datasets(path:str) -> Dict[str,List[Tuple[str,Path]]]:
def main() -> None:
import sys
import pprint
pprint.pprint(list_datasets(sys.argv[1]))
if len(sys.argv) == 1:
pprint.pprint(list_datasets(DATA_PATH))
else:
pprint.pprint(list_datasets(sys.argv[1]))


if __name__ == '__main__':
Expand Down

0 comments on commit 0922271

Please sign in to comment.