Open2024/02/09にコメント追加1TyperのCustom ClassPythontypera22024/02/09に更新 Time Delta def parse_timedelta_class(value: str): return pd.to_timedelta(value).total_seconds() How to use unit_time: Annotated[float, typer.Option('-u', '--unit-time', parser=parse_timedelta_class, metavar='TIME_DELTA', help='Unit time')] = '1s'
a22024/02/09に更新 Time Delta def parse_timedelta_class(value: str): return pd.to_timedelta(value).total_seconds() How to use unit_time: Annotated[float, typer.Option('-u', '--unit-time', parser=parse_timedelta_class, metavar='TIME_DELTA', help='Unit time')] = '1s'