fix ruff linter errors - #368
Draft
ajcasagrande wants to merge 1 commit into
Draft
Conversation
Closed
There was a problem hiding this comment.
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. |
debermudez
reviewed
Apr 24, 2025
debermudez
left a comment
Contributor
There was a problem hiding this comment.
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.
| 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 |
Contributor
There was a problem hiding this comment.
Are these syntactically the same?
| 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 |
ajcasagrande
marked this pull request as draft
April 25, 2025 23:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
#noqaflag to them. In the future I recommend we addruffchecks as standard, but open to discussion.