-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcli.py
More file actions
37 lines (26 loc) · 894 Bytes
/
cli.py
File metadata and controls
37 lines (26 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import logging
import typer
from omegaconf import DictConfig
from ice_station_zebra.cli import hydra_adaptor
from .zebra_data_processor_factory import ZebraDataProcessorFactory
# Create the typer app
datasets_cli = typer.Typer(help="Manage datasets")
log = logging.getLogger(__name__)
@datasets_cli.command("create")
@hydra_adaptor
def create(config: DictConfig) -> None:
"""Create all datasets"""
factory = ZebraDataProcessorFactory(config)
for dataset in factory.datasets:
log.info(f"Working on {dataset.name}")
dataset.create()
@datasets_cli.command("inspect")
@hydra_adaptor
def inspect(config: DictConfig) -> None:
"""Inspect all datasets"""
factory = ZebraDataProcessorFactory(config)
for dataset in factory.datasets:
log.info(f"Working on {dataset.name}")
dataset.inspect()
if __name__ == "__main__":
datasets_cli()