Skip to content

Commit

Permalink
tiny refactor in opuscleaner.datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
jindrahelcl committed Nov 25, 2023
1 parent c13aed6 commit ddc2a51
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 ddc2a51

Please sign in to comment.