Skip to content

Conversation

ajcasagrande
Copy link
Contributor

Various fixes based on ruff linter errors. Most should be harmless, however worth double checking, in case some rules were broken on purpose in which case we should add a #noqa flag to them. In the future I recommend we add ruff checks as standard, but open to discussion.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses various ruff linter errors by removing unused imports and correcting string formatting in error messages. The changes are mostly cosmetic and aim to comply with updated linter rules without affecting the application’s functionality.

  • Removed unused imports and redundant code from multiple modules.
  • Updated error message strings to avoid unintended f-string behavior.
  • Cleaned up import statements to improve code clarity.

Reviewed Changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated no comments.

Show a summary per file
File Description
genai-perf/genai_perf/telemetry_data/triton_telemetry_data_collector.py Removed an unused import of Dict and List.
genai-perf/genai_perf/subcommand/profile.py Removed unused imports from configuration files.
genai-perf/genai_perf/subcommand/common.py Eliminated several redundant imports to reduce noise.
genai-perf/genai_perf/subcommand/analyze.py Removed unused variables and imports; updated error-related strings.
genai-perf/genai_perf/plots/plot_config.py Removed unnecessary import from collections.abc.
genai-perf/genai_perf/parser.py Changed f-string usage in error messages to literal strings for clarity.
genai-perf/genai_perf/inputs/retrievers/synthetic_image_generator.py Removed unused Enum import.
genai-perf/genai_perf/inputs/retrievers/synthetic_audio_generator.py Removed unused Enum and List imports.
genai-perf/genai_perf/inputs/input_constants.py Updated the import of Enum to exclude auto.
genai-perf/genai_perf/inputs/converters/tensorrtllm_engine_converter.py Removed an unused jinja2 import.
genai-perf/genai_perf/inputs/converters/dynamic_grpc_converter.py Fixed string formatting in exception messages.
genai-perf/genai_perf/goodput_calculator/llm_goodput_calculator.py Removed an unused Optional and Union from type hints.
genai-perf/genai_perf/export_data/json_exporter.py Removed unused Enum import.
genai-perf/genai_perf/export_data/exporter_config.py Removed unused argparse alias and pathlib import.
genai-perf/genai_perf/config/input/config_endpoint.py Replaced f-string with a literal string in error message.
genai-perf/genai_perf/config/input/config_command.py Updated error messages to use literal strings for consistency.
genai-perf/genai_perf/config/input/base_config.py Replaced “if not name in” with “if name not in” for clarity.
genai-perf/genai_perf/config/generate/search_parameters.py Adjusted error messages to remove redundant f-string markers.
genai-perf/genai_perf/config/generate/perf_analyzer_config.py Removed unnecessary f-string markers in CLI argument construction.
genai-perf/genai_perf/config/generate/genai_perf_config.py Removed redundant import for argparse.

Copy link
Contributor

@debermudez debermudez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 question repeated in a few places.
As a one off pass, i think this is good.
But lets automate it from day 1 in the new project.

@@ -195,7 +195,7 @@ def _get_artifact_stimulus_based_on_config(
) -> Optional[List[str]]:
if (
config.input.prompt_source == PromptSource.PAYLOAD
and not "session_concurrency" in config.perf_analyzer.stimulus
and "session_concurrency" not in config.perf_analyzer.stimulus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these syntactically the same?

@@ -338,7 +338,7 @@ def _add_prompt_source_args(self, config: ConfigCommand) -> List[str]:
prompt_source_args = []
if (
config.input.prompt_source == PromptSource.PAYLOAD
and not "session_concurrency" in config.perf_analyzer.stimulus
and "session_concurrency" not in config.perf_analyzer.stimulus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these the same?

@ajcasagrande ajcasagrande marked this pull request as draft April 25, 2025 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants