Skip to content

Commit 6ef1abd

Browse files
committed
Update cli.py
Finalizing typer changes
1 parent 6da914c commit 6ef1abd

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

src/wristpy/core/cli.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
)
1717

1818

19+
class OutputFileType(str, Enum):
20+
"""Valid output file types for saving data."""
21+
22+
csv = "csv"
23+
parquet = "parquet"
24+
25+
1926
class Calibrator(str, Enum):
2027
"""Setting a calibrator class for typer.
2128
@@ -53,13 +60,13 @@ def main(
5360
input: pathlib.Path = typer.Argument(
5461
..., help="Path to the input data.", exists=True
5562
),
56-
output: Optional[pathlib.Path] = typer.Option(
63+
output: pathlib.Path = typer.Option(
5764
None,
5865
"-o",
5966
"--output",
6067
help="Path where data will be saved. Supports .csv and .parquet formats.",
6168
),
62-
output_filetype: Optional[str] = typer.Option(
69+
output_filetype: OutputFileType = typer.Option(
6370
None,
6471
"-O",
6572
"--output-filetype",
@@ -141,13 +148,13 @@ def main(
141148
orchestrator.run(
142149
input=input,
143150
output=output,
144-
calibrator=calibrator.value if calibrator else None,
151+
calibrator=calibrator.value if calibrator else None, # type: ignore[arg-type] # Covered by Calibrator Enum class
145152
activity_metric=activity_metric.value,
146153
thresholds=None if thresholds is None else thresholds,
147154
epoch_length=epoch_length,
148-
nonwear_algorithm=nonwear_algorithms,
155+
nonwear_algorithm=nonwear_algorithms, # type: ignore[arg-type] # Covered by NonwearAlgorithm Enum class
149156
verbosity=log_level,
150-
output_filetype=output_filetype,
157+
output_filetype=output_filetype, # type: ignore[arg-type] # Covered by OutputFileType Enum class
151158
)
152159

153160

0 commit comments

Comments
 (0)