Open jellyfishcake opened 1 month ago
@jellyfishcake Could you please assign me this issue? I'd also appreciate any insights or suggestions on where I should start
@jellyfishcake Could you please assign me this issue? I'd also appreciate any insights or suggestions on where I should start
Assigned. I just start with the /linux_benchmark files or /linux_packages files.
@jellyfishcake I am currently working on adding type annotations for the aerospike_benchmarks.py
file in the Linux benchmarks.
However, I am having difficulty with the type annotation for user_config
. Could you please assist me with this?
@jellyfishcake How do i build the intuition that this parameter
would have this type annotation
?
@jellyfishcake How do i build the intuition that this
parameter
would have thistype annotation
? @jellyfishcake I did find that certain files already have thefunction
with thetype annotations
like
cuda_memcpy_benchmark.py
already had , so i applied them to aerospike_benchmark.py
, is that all right ?
@jellyfishcake I am currently working on adding type annotations for the
aerospike_benchmarks.py
file in theLinux benchmarks.
However, I am having difficulty with the type annotation foruser_config
. Could you please assist me with this?
well i got this from the same cuda_memcpy_benchamark.py
file :)
@jellyfishcake I had the file aerospike_benchmark.py
updated and raised the Pull Request
, could please provide feedback, Thanks for the response earlier for suggesting where to start from , it helped a lot
Add more type annotations to almost any file in PKB. Python is by default untyped, but optional type annotations add clarity & help detect errors.
Some files like https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/providers/gcp/vertex_ai.py already have type annotations. Many have some annotations but are also missing some.
See https://docs.python.org/3/library/typing.html for more information & examples of type annotations.
After adding type annotations, use pytype to check if annotations are correct or break anything. See here for install instructions:
https://github.com/google/pytype
But the short version is
pip install pytype pytype _file.py
will output if the file has any errors after adding the type annotations
Some classes could also use attribute lists like:
class VertexAiModelSpec(managed_ai_model_spec.BaseManagedAiModelSpec): """Spec for a Vertex AI model.
Attributes: env_vars: Environment variables set on the node. serving_container_command: Command run on container to start the model. serving_container_args: The arguments passed to container create. """
def init(): self.container_image_uri: str self.model_bucket_suffix: str self.serving_container_command: list[str]