SmartSim icon indicating copy to clipboard operation
SmartSim copied to clipboard

[MLI] Utilize new typing features in dragon utils

Open MattToast opened this issue 1 year ago • 0 comments

Description

In smartsim._core.mli.infrastructure.control.dragon_util the function function_as_dragon_proc can benefit from leveraging newer typing features.

Justification

Nicer typing allows for better static analysis and better code correctness w/o needing to manually write tests.

Implementation Strategy

Update smartsim._core.mli.infrastructure.control.dragon_util to read

from tpying_extentsions import TypeVarTuple, Unpack

if t.TYPE_CHECKING:
    _Ts = TypeVarTuple("_Ts")


def function_as_dragon_proc(
    entrypoint_fn: t.Callable[[Unpack[_Ts]], None],
    args: tuple[Unpack[_Ts]],
    ... # Additional args here
) -> dragon_process.Process:
    ...

Acceptance Criteria

  • [ ] Function is properly typed
  • [ ] Any type errors are resolved
  • [ ] CI passes

MattToast avatar Oct 24 '24 21:10 MattToast