Skip to content

Commit 87e1e3b

Browse files
author
Alessio Perilli
committed
Fix lint warnings: remove unused imports/variables, fix f-strings
1 parent 9f14d12 commit 87e1e3b

9 files changed

Lines changed: 13 additions & 26 deletions

src/PP_IntroEnd.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import json
22
import logging
3-
from pathlib import Path
43
import re
5-
import math
64

75
# Configure logging
86
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
@@ -58,7 +56,7 @@ def refine_chart_intro_end(sm_file_path, analysis_data_path="analysis_data.json"
5856
fade_out_start_beat = beat_idx
5957
break
6058

61-
logger.info(f"Intro/End Analysis:")
59+
logger.info("Intro/End Analysis:")
6260
logger.info(f" First Active Beat: {first_active_beat}")
6361
logger.info(f" Fade Out Start: {fade_out_start_beat}")
6462
logger.info(f" Last Active Beat: {last_active_beat}")

src/PP_azioniFinali.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def main():
2323
directory = os.path.dirname(sm_path)
2424
sm_filename = os.path.basename(sm_path)
2525

26-
print(f"--- Running Final Actions ---")
26+
print("--- Running Final Actions ---")
2727
print(f"Analyzing file: {sm_filename}")
2828

2929
# 1. Find the MP3 filename by reading the .sm file

src/PP_mute.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(self, sm_input, sm_output, analysis_file):
3030
self.analysis_file = Path(analysis_file)
3131

3232
def run(self):
33-
logger.info(f"🔇 Starting Mute Refiner...")
33+
logger.info("🔇 Starting Mute Refiner...")
3434

3535
# 1. Load Analysis
3636
try:
@@ -153,8 +153,7 @@ def get_rms_at_beat(beat_idx):
153153
measures_raw = clean_data_str.split(',')
154154
cleaned_measures = []
155155

156-
total_measures = len(measures_raw)
157-
156+
158157
for m_idx, m_str in enumerate(measures_raw):
159158
rows = [r.strip() for r in m_str.strip().split('\n') if r.strip()]
160159
num_rows = len(rows)

src/add_grafic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,8 @@ def validate_image_url(url, min_w=256, min_h=256):
394394
except Exception:
395395
pass
396396
return True, w, h
397-
except Exception as e:
398-
# print(f"DEBUG: Validation error for {url}: {e}")
397+
except Exception:
398+
# print(f"DEBUG: Validation error")
399399
return False, 0, 0
400400

401401
def wikipedia_valid_thumb(query, min_w=256, min_h=256):

src/audioYouTube.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def main():
9696
raw_url = sys.argv[1]
9797
url = clean_youtube_url(raw_url)
9898

99-
print(f"\n--- YouTube Audio Downloader ---")
99+
print("\n--- YouTube Audio Downloader ---")
100100
print(f"Target URL: {url}")
101101

102102
# 1. Ask for details

src/calibrazione_manuale.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import os
2-
import sys
32
import time
4-
import json
53
import pygame
64
import librosa
75
import numpy as np
@@ -138,17 +136,17 @@ def load_audio_analysis(file_path):
138136
print(f"{Colors.BLUE}⏳ Advanced BPM Analysis (Full Song + Phase Check) in progress...{Colors.ENDC}")
139137
try:
140138
# 1. Audio Loading
141-
print(f" Full audio loaded (22050Hz)...")
139+
print(" Full audio loaded (22050Hz)...")
142140
y, sr = librosa.load(file_path, sr=22050)
143141
total_duration = librosa.get_duration(y=y, sr=sr)
144142

145143
# 2. Onset Envelope
146144
hop_len = 128
147-
print(f" Computing Onset Envelope...")
145+
print(" Computing Onset Envelope...")
148146
onset_env = librosa.onset.onset_strength(y=y, sr=sr, hop_length=hop_len)
149147

150148
# 3. Generate Candidates
151-
print(f" Generating BPM Candidates (FFT + Autocorr)...")
149+
print(" Generating BPM Candidates (FFT + Autocorr)...")
152150
# We reduce base n_candidates to be more selective
153151
fft_candidates = get_top_bpm_candidates_fft(onset_env, sr, hop_len, n_candidates=4)
154152
ac_candidates = get_candidates_autocorr(onset_env, sr, hop_len, n_candidates=4)
@@ -165,7 +163,6 @@ def load_audio_analysis(file_path):
165163

166164
# Generate Variants (with score penalty)
167165
final_pool = []
168-
seen_bpms = []
169166

170167
def add_candidate(bpm, score):
171168
if not (40 <= bpm <= 250): return
@@ -395,7 +392,6 @@ def generate_tick_sound(freq, duration_sec, sr):
395392
clock = pygame.time.Clock()
396393

397394
# Playback Time Management
398-
music_start_time = time.time()
399395
playback_offset = 0.0 # Temporal offset due to seeks (forward/backward)
400396

401397
# Volume Control

src/modifica_steps.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import os
2-
import sys
32
import json
43
import re
54
import random
6-
import subprocess
75
import numpy as np
8-
import glob
96
import traceback
107

118
# Color Configuration
@@ -174,7 +171,7 @@ def parse_charts_metadata(self, sm_path):
174171
# Se ci sono più parti, desc potrebbe contenere ':'
175172
if len(parts) >= 5:
176173
chart_type = parts[0]
177-
radar = parts[-1]
174+
_ = parts[-1]
178175
meter = parts[-2]
179176
difficulty = parts[-3]
180177
# Descrizione è tutto ciò che sta in mezzo
@@ -278,7 +275,6 @@ def modify_steps(self, measures, analysis_data, is_increase, percentage):
278275
row_has_hold_head = True
279276

280277
# Count active inputs at THIS moment (including newly started ones)
281-
active_holds_count_now = sum(1 for x in active_holds if x)
282278

283279
# How many taps in this row?
284280
taps_in_row = cols.count('1')

src/stepmania_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def set_tag_val(tag, val, text):
268268
try:
269269
if float(curr_sample) <= 0.001:
270270
header = set_tag_val("SAMPLESTART", "20.000", header)
271-
print(f" 🔹 SampleStart fixed to: 20.000")
271+
print(" 🔹 SampleStart fixed to: 20.000")
272272
except:
273273
pass
274274

@@ -277,7 +277,7 @@ def set_tag_val(tag, val, text):
277277
try:
278278
if not curr_len or float(curr_len) <= 0.001:
279279
header = set_tag_val("SAMPLELENGTH", "15.000", header)
280-
print(f" 🔹 SampleLength fixed to: 15.000")
280+
print(" 🔹 SampleLength fixed to: 15.000")
281281
except:
282282
pass
283283

src/support_me.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import os
2-
import sys
31
import webbrowser
42

53
def main():

0 commit comments

Comments
 (0)