Skip to content

Add type hints to simple_grpc_aio_infer_client.py#878

Open
gwencasey96 wants to merge 1 commit intotriton-inference-server:mainfrom
gwencasey96:add-type-hints-grpc-aio-example
Open

Add type hints to simple_grpc_aio_infer_client.py#878
gwencasey96 wants to merge 1 commit intotriton-inference-server:mainfrom
gwencasey96:add-type-hints-grpc-aio-example

Conversation

@gwencasey96
Copy link
Copy Markdown

Summary

  • Add type hints to all functions in simple_grpc_aio_infer_client.py
  • Improves code readability and enables static type checking with mypy
  • Follows existing code style and passes all pre-commit hooks

Changes

  • get_triton_client: Added parameter and return type annotations
  • get_inputs_and_outputs: Added return type for tuple of inputs, outputs, and numpy arrays
  • get_output: Added type hints for numpy arrays and InferResult parameter
  • main: Added async function type hints

Test plan

  • File compiles successfully with Python 3
  • Passes black formatting check
  • Passes isort import ordering check
  • Passes flake8 linting with project configuration
  • Type hints use proper numpy.typing annotations

🤖 Generated with Claude Code

This commit adds type hints to all functions in the async gRPC example:
- get_triton_client: Returns InferenceServerClient
- get_inputs_and_outputs: Returns tuple of inputs, outputs, and numpy arrays
- get_output: Takes numpy arrays and InferResult, returns None
- main: Takes argparse.Namespace, returns None

Type hints improve code readability and enable static type checking
with mypy. The changes follow the project's existing code style and
pass all pre-commit hooks (black, isort, flake8).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant