Skip to content

chore: format python in aitk#429

Open
xieofxie wants to merge 3 commits into
mainfrom
hualxie/format_python
Open

chore: format python in aitk#429
xieofxie wants to merge 3 commits into
mainfrom
hualxie/format_python

Conversation

@xieofxie
Copy link
Copy Markdown
Contributor

@xieofxie xieofxie commented May 25, 2026

ipynb will be included later

Copilot AI review requested due to automatic review settings May 25, 2026 06:38
@xieofxie xieofxie requested review from a team as code owners May 25, 2026 06:38
Copy link
Copy Markdown
Contributor

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 standardizes Python formatting across multiple AITK recipe scripts and replaces the previous auto-formatting approach with a Ruff-based lint/format step integrated into the .aitk/scripts/sanitize.py entrypoint.

Changes:

  • Reformat many AITK Python scripts (imports, whitespace, line wrapping, dict/list formatting).
  • Replace the removed auto_formatter.py path with a new ruff_check.py helper and add ruff to .aitk/scripts/requirements.txt.
  • Minor cleanup tweaks across workflows/evaluation helpers (e.g., trailing commas, consistent quoting, small refactors from formatting).

Reviewed changes

Copilot reviewed 62 out of 65 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
sd2-community-stable-diffusion-2-1/aitk/sd_utils/qdq.py Import ordering/whitespace formatting.
sd2-community-stable-diffusion-2-1/aitk/sd_utils/ov.py Import cleanup + formatting (dict formatting/trailing commas).
sd2-community-stable-diffusion-2-1/aitk/sd_utils/ort.py Formatting of long calls / whitespace cleanup.
sd2-community-stable-diffusion-2-1/aitk/sd_utils/onnx_patch.py Import ordering + whitespace cleanup.
sd2-community-stable-diffusion-2-1/aitk/sd_qnn_workflow.py Formatting + subprocess invocation wrapping.
sd2-community-stable-diffusion-2-1/aitk/sd_qnn_evaluation.py Formatting + consistent quoting/trailing commas.
sd2-community-stable-diffusion-2-1/aitk/sd_ov_workflow.py Formatting + subprocess invocation wrapping.
sd2-community-stable-diffusion-2-1/aitk/sd_ov_evaluation.py Formatting + consistent quoting/trailing commas.
sd2-community-stable-diffusion-2-1/aitk/evaluation.py Comment formatting cleanup.
sd-legacy-stable-diffusion-v1-5/aitk/sd_utils/qdq.py Import ordering/whitespace formatting.
sd-legacy-stable-diffusion-v1-5/aitk/sd_utils/ov.py Import cleanup + formatting (dict formatting/trailing commas).
sd-legacy-stable-diffusion-v1-5/aitk/sd_utils/ort.py Formatting of long calls / whitespace cleanup.
sd-legacy-stable-diffusion-v1-5/aitk/sd_utils/onnx_patch.py Import ordering + whitespace cleanup.
sd-legacy-stable-diffusion-v1-5/aitk/sd_qnn_workflow.py Formatting + subprocess invocation wrapping.
sd-legacy-stable-diffusion-v1-5/aitk/sd_qnn_evaluation.py Formatting + consistent quoting/trailing commas.
sd-legacy-stable-diffusion-v1-5/aitk/sd_ov_workflow.py Formatting + subprocess invocation wrapping.
sd-legacy-stable-diffusion-v1-5/aitk/sd_ov_evaluation.py Formatting + consistent quoting/trailing commas.
sd-legacy-stable-diffusion-v1-5/aitk/evaluation.py Comment formatting cleanup.
sam2.1-hiera-small/aitk/sam2_qnn_workflow.py Formatting + subprocess invocation wrapping; import ordering.
sam2.1-hiera-small/aitk/sam2_qnn_evaluation.py Formatting + import ordering; line wrapping.
sam2.1-hiera-small/aitk/sam2_mask_generator.py Formatting + import cleanup and line wrapping.
sam2.1-hiera-small/aitk/generate_model.py Formatting of torch.onnx.export calls.
sam-vit-base/aitk/user_script.py Import ordering formatting.
sam-vit-base/aitk/sam_qnn_workflow.py Formatting + subprocess invocation wrapping; import ordering.
sam-vit-base/aitk/sam_qnn_evaluation.py Formatting + consistent quoting/trailing commas.
sam-vit-base/aitk/sam_mask_generator.py Formatting + import cleanup and line wrapping.
sam-vit-base/aitk/model_patches.py Formatting of keyword arguments spacing.
sam-vit-base/aitk/config.py Whitespace formatting.
openai-whisper-large-v3-turbo/aitk/whisper_encoder_load.py Import ordering + line wrapping.
openai-whisper-large-v3-turbo/aitk/whisper_decoder_load.py Import ordering + line wrapping.
openai-whisper-large-v3-turbo/aitk/qnn_workflow.py Formatting + subprocess invocation wrapping; minor string formatting cleanup.
openai-whisper-large-v3-turbo/aitk/qnn_run.py Import ordering + formatting; small comment formatting.
openai-whisper-large-v3-turbo/aitk/qnn_evaluate.py Formatting + import ordering; dict formatting.
openai-whisper-large-v3-turbo/aitk/qnn_app.py Formatting of session initialization calls.
openai-whisper-large-v3-turbo/aitk/ov_workflow.py Formatting + subprocess invocation wrapping.
openai-whisper-large-v3-turbo/aitk/ov_evaluate.py Formatting + minor indentation cleanup and line wrapping.
openai-whisper-large-v3-turbo/aitk/convert_whisper_to_ovir.py Formatting and line wrapping; consistent quoting; small helper refactors (layout only).
openai-clip-vit-large-patch14/aitk/user_script.py Import ordering formatting.
openai-clip-vit-large-patch14/aitk/openai_clip_ov.py Import ordering + minor function signature formatting.
openai-clip-vit-base-patch32/aitk/user_script.py Import ordering formatting.
openai-clip-vit-base-patch32/aitk/openai_clip_ov.py Import ordering + minor function signature formatting.
openai-clip-vit-base-patch16/aitk/user_script.py Import ordering formatting.
openai-clip-vit-base-patch16/aitk/openai_clip_ov.py Import ordering + minor function signature formatting.
OFA-Sys-chinese-clip-vit-base-patch16/aitk/openai_clip_ov.py Import ordering + consistent quoting + line wrapping.
microsoft-resnet-50/aitk/imagenet.py Import cleanup + formatting; minor condition formatting.
microsoft-resnet-50/aitk/imagenet-qnn-gpu.py Import ordering formatting.
laion-CLIP-ViT-B-32-laion2B-s34B-b79K/aitk/user_script.py Import ordering formatting.
laion-CLIP-ViT-B-32-laion2B-s34B-b79K/aitk/laion_clip_ov.py Import ordering + minor function signature formatting.
intel-bert-base-uncased-mrpc/aitk/user_script.py Import ordering formatting.
google-vit-base-patch16-224/aitk/vit-base-patch16-224.py Import cleanup + formatting; minor condition formatting.
google-bert-bert-base-multilingual-cased/aitk/user_script.py Formatting + line wrapping of dataset loading call.
.aitk/scripts/sanitize/parameters.py Formatting for long json.dumps call.
.aitk/scripts/sanitize/model_parameter.py Formatting of long conditionals and function calls.
.aitk/scripts/sanitize/generator_qnn.py Fix invalid f-string formatting + import ordering.
.aitk/scripts/sanitize/generator_intel.py Fix invalid f-string formatting + import ordering.
.aitk/scripts/sanitize/generator_amd.py Fix invalid f-string formatting + import ordering.
.aitk/scripts/sanitize/file_validation.py Consistent quoting in error message.
.aitk/scripts/sanitize.py Switch to Ruff-based formatting/check integration.
.aitk/scripts/ruff_check.py New Ruff lint/format runner for .aitk/ and */aitk/.
.aitk/scripts/requirements.txt Pin script dependencies and add Ruff.
.aitk/scripts/requirements_check.py Minor whitespace formatting.
.aitk/scripts/project_processor.py Formatting-only changes (sorting lambdas, slicing spacing, line wrapping).
.aitk/scripts/install_freeze.py Remove unused variable assignment from subprocess.run.
.aitk/scripts/bump_model_versions.py Minor slicing/whitespace formatting.
.aitk/scripts/auto_formatter.py Removed (replaced by Ruff-based approach).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .aitk/scripts/ruff_check.py
Comment thread .aitk/scripts/ruff_check.py Outdated
Comment thread .aitk/scripts/sanitize.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

3 participants