fix: remove dead f-string prefixes via ruff F541 (216 sites) (#52336)
ruff check --fix --select F541 . on current main. Pure prefix removals; adjacent-string concatenations keep the f only on interpolating fragments. No string content or live placeholder altered.
This commit is contained in:
@@ -1265,7 +1265,7 @@ Write only the summary, starting with "[CONTEXT SUMMARY]:" prefix."""
|
||||
skipped_pct = (skipped / max(total, 1)) * 100
|
||||
over_limit_pct = (over_limit / max(total, 1)) * 100
|
||||
|
||||
print(f"\n")
|
||||
print("\n")
|
||||
print(f"╔{'═'*70}╗")
|
||||
print(f"║{'TRAJECTORY COMPRESSION REPORT':^70}║")
|
||||
print(f"╠{'═'*70}╣")
|
||||
@@ -1348,7 +1348,7 @@ Write only the summary, starting with "[CONTEXT SUMMARY]:" prefix."""
|
||||
ratios = self.aggregate_metrics.compression_ratios
|
||||
tokens_saved_list = self.aggregate_metrics.tokens_saved_list
|
||||
|
||||
print(f"\n📊 Distribution Summary:")
|
||||
print("\n📊 Distribution Summary:")
|
||||
print(f" Compression ratios: min={min(ratios):.2%}, max={max(ratios):.2%}, median={sorted(ratios)[len(ratios)//2]:.2%}")
|
||||
print(f" Tokens saved: min={min(tokens_saved_list):,}, max={max(tokens_saved_list):,}, median={sorted(tokens_saved_list)[len(tokens_saved_list)//2]:,}")
|
||||
|
||||
@@ -1431,7 +1431,7 @@ def main(
|
||||
is_file_input = input_path.is_file()
|
||||
|
||||
if is_file_input:
|
||||
print(f"📄 Input mode: Single JSONL file")
|
||||
print("📄 Input mode: Single JSONL file")
|
||||
|
||||
# For file input, default output is file with _compressed suffix
|
||||
if output:
|
||||
@@ -1461,7 +1461,7 @@ def main(
|
||||
print(f" Sampled {len(entries):,} trajectories ({sample_percent}% of {total_entries:,})")
|
||||
|
||||
if dry_run:
|
||||
print(f"\n🔍 DRY RUN MODE - analyzing without writing")
|
||||
print("\n🔍 DRY RUN MODE - analyzing without writing")
|
||||
print(f"📄 Would process: {len(entries):,} trajectories")
|
||||
print(f"📄 Would output to: {output_path}")
|
||||
return
|
||||
@@ -1497,12 +1497,12 @@ def main(
|
||||
shutil.copy(metrics_file, metrics_output)
|
||||
print(f"💾 Metrics saved to {metrics_output}")
|
||||
|
||||
print(f"\n✅ Compression complete!")
|
||||
print("\n✅ Compression complete!")
|
||||
print(f"📄 Output: {output_path}")
|
||||
|
||||
else:
|
||||
# Directory input - original behavior
|
||||
print(f"📁 Input mode: Directory of JSONL files")
|
||||
print("📁 Input mode: Directory of JSONL files")
|
||||
|
||||
if output:
|
||||
output_path = Path(output)
|
||||
@@ -1548,7 +1548,7 @@ def main(
|
||||
print(f" Sampled {total_sampled:,} from {total_original:,} total trajectories")
|
||||
|
||||
if dry_run:
|
||||
print(f"\n🔍 DRY RUN MODE - analyzing without writing")
|
||||
print("\n🔍 DRY RUN MODE - analyzing without writing")
|
||||
print(f"📁 Would process: {temp_input_dir}")
|
||||
print(f"📁 Would output to: {output_path}")
|
||||
return
|
||||
@@ -1558,7 +1558,7 @@ def main(
|
||||
compressor.process_directory(temp_input_dir, output_path)
|
||||
else:
|
||||
if dry_run:
|
||||
print(f"\n🔍 DRY RUN MODE - analyzing without writing")
|
||||
print("\n🔍 DRY RUN MODE - analyzing without writing")
|
||||
print(f"📁 Would process: {input_path}")
|
||||
print(f"📁 Would output to: {output_path}")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user