|
33 | 33 |
|
34 | 34 | @dataclasses.dataclass(frozen=True, kw_only=True) |
35 | 35 | class Args(cli_utils.Args): |
36 | | - """Commands for downloading and preparing datasets. |
37 | | -
|
38 | | - Attributes: |
39 | | - positional_datasets: Name(s) of the dataset(s) to build. Default to current |
40 | | - dir. See https://www.tensorflow.org/datasets/cli for accepted values. |
41 | | - datasets: Datasets can also be provided as keyword argument. |
42 | | - debug: Debug & tests options. Use --pdb to enter post-mortem debugging mode |
43 | | - if an exception is raised. |
44 | | - paths: Path options. |
45 | | - generation: Generation options. |
46 | | - publishing: Publishing options. |
47 | | - automation: Automation options. |
48 | | - """ |
| 36 | + """Commands for downloading and preparing datasets.""" |
49 | 37 |
|
50 | | - positional_datasets: list[str] = simple_parsing.field( |
| 38 | + # Name(s) of the dataset(s) to build. Default to current dir. See |
| 39 | + # https://www.tensorflow.org/datasets/cli for accepted values. |
| 40 | + positional_datasets: list[str] = simple_parsing.list_field( |
51 | 41 | positional=True, |
52 | | - nargs='*', |
53 | | - default_factory=list, |
54 | 42 | # Need to explicitly set metavar for command-line help. |
55 | 43 | metavar='datasets', |
56 | 44 | ) |
57 | | - datasets: list[str] = simple_parsing.field(nargs='*', default_factory=list) |
| 45 | + |
| 46 | + datasets: list[str] = simple_parsing.list_field(alias='--dataset') |
| 47 | + """Datasets can also be provided as keyword argument.""" |
58 | 48 |
|
59 | 49 | debug: cli_utils.DebugOptions = cli_utils.DebugOptions() |
| 50 | + """Debug & tests options. Use --pdb to enter post-mortem debugging mode if an |
| 51 | + exception is raised.""" |
| 52 | + |
60 | 53 | paths: cli_utils.PathOptions = simple_parsing.field( |
61 | 54 | default_factory=cli_utils.PathOptions |
62 | 55 | ) |
| 56 | + """Path options.""" |
| 57 | + |
63 | 58 | generation: cli_utils.GenerationOptions = simple_parsing.field( |
64 | 59 | default_factory=cli_utils.GenerationOptions |
65 | 60 | ) |
| 61 | + """Generation options.""" |
| 62 | + |
66 | 63 | publishing: cli_utils.PublishingOptions = simple_parsing.field( |
67 | 64 | default_factory=cli_utils.PublishingOptions |
68 | 65 | ) |
| 66 | + """Publishing options.""" |
| 67 | + |
69 | 68 | automation: cli_utils.AutomationOptions = simple_parsing.field( |
70 | 69 | default_factory=cli_utils.AutomationOptions |
71 | 70 | ) |
| 71 | + """Automation options.""" |
72 | 72 |
|
73 | 73 | def execute(self) -> None: |
74 | 74 | """Build the given datasets.""" |
|
0 commit comments