Skip to content

Commit f6faacd

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 84f7d3d commit f6faacd

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

examples/combining_color_representations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
spectrum = color_value
101101
print(
102102
f"""First few spectral values: {
103-
' '.join(map(str, spectrum.value[:5]))
103+
" ".join(map(str, spectrum.value[:5]))
104104
}..."""
105105
)
106106

@@ -124,6 +124,6 @@
124124

125125
print(
126126
f"""Available color representations for {obj.name}: {
127-
', '.join(representations)
127+
", ".join(representations)
128128
}"""
129129
)

examples/working_with_spectral_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
print(f"Number of spectral values: {len(spectrum.value)}")
7373
print(
7474
f"""First few spectral values: {
75-
' '.join(map(str,spectrum.value[:5]))
75+
" ".join(map(str, spectrum.value[:5]))
7676
}..."""
7777
)
7878

@@ -135,6 +135,6 @@
135135
print(f"Number of spectral values: {len(spectrum.value)}")
136136
print(
137137
f"""First few spectral values: {
138-
' '.join(map(str,spectrum.value[:5]))
138+
" ".join(map(str, spectrum.value[:5]))
139139
}..."""
140140
)

tasks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ def inner(text: str) -> str:
133133
"""Format and pads inner text for the message box."""
134134

135135
return (
136-
f'*{" " * padding}'
137-
f'{text}{" " * (width - len(text) - padding * 2 - 2)}'
138-
f'{" " * padding}*'
136+
f"*{' ' * padding}"
137+
f"{text}{' ' * (width - len(text) - padding * 2 - 2)}"
138+
f"{' ' * padding}*"
139139
)
140140

141141
print_callable("=" * width)

utilities/benchmark_parsing.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def generate_large_cxf_file(num_samples: int) -> bytes:
123123
xml_bytes = xml_content.encode("utf-8")
124124

125125
print(
126-
f"Generated CxF file: {len(xml_bytes):,} bytes ({len(xml_bytes)/1024/1024:.1f} MB)"
126+
f"Generated CxF file: {len(xml_bytes):,} bytes ({len(xml_bytes) / 1024 / 1024:.1f} MB)"
127127
)
128128
return xml_bytes
129129

@@ -177,8 +177,8 @@ def benchmark_parsing_performance(num_samples: int) -> dict[str, float | int]:
177177
cpu_count = psutil.cpu_count()
178178
memory_info = psutil.virtual_memory()
179179

180-
print(f"System: {cpu_count} CPU cores, {memory_info.total/1024**3:.1f} GB RAM")
181-
print(f"File size: {len(cxf_data):,} bytes ({len(cxf_data)/1024/1024:.1f} MB)")
180+
print(f"System: {cpu_count} CPU cores, {memory_info.total / 1024**3:.1f} GB RAM")
181+
print(f"File size: {len(cxf_data):,} bytes ({len(cxf_data) / 1024 / 1024:.1f} MB)")
182182

183183
# Benchmark 1: Parsing with schema validation
184184
print("\n1. Parsing with schema validation...")
@@ -203,7 +203,7 @@ def benchmark_parsing_performance(num_samples: int) -> dict[str, float | int]:
203203
f" Objects parsed: {len(cxf_obj.resources.object_collection.object_value):,}"
204204
)
205205
print(
206-
f" Throughput: {len(cxf_obj.resources.object_collection.object_value)/parse_time_with_validation:.0f} objects/second"
206+
f" Throughput: {len(cxf_obj.resources.object_collection.object_value) / parse_time_with_validation:.0f} objects/second"
207207
)
208208

209209
# Clear memory
@@ -232,7 +232,7 @@ def benchmark_parsing_performance(num_samples: int) -> dict[str, float | int]:
232232
f" Objects parsed: {len(cxf_obj.resources.object_collection.object_value):,}"
233233
)
234234
print(
235-
f" Throughput: {len(cxf_obj.resources.object_collection.object_value)/parse_time_without_validation:.0f} objects/second"
235+
f" Throughput: {len(cxf_obj.resources.object_collection.object_value) / parse_time_without_validation:.0f} objects/second"
236236
)
237237

238238
# Performance comparison
@@ -243,10 +243,10 @@ def benchmark_parsing_performance(num_samples: int) -> dict[str, float | int]:
243243
)
244244
print(f" Speedup without validation: {speedup:.2f}x")
245245
print(
246-
f" Data throughput (with validation): {len(cxf_data)/1024/1024/parse_time_with_validation:.1f} MB/second"
246+
f" Data throughput (with validation): {len(cxf_data) / 1024 / 1024 / parse_time_with_validation:.1f} MB/second"
247247
)
248248
print(
249-
f" Data throughput (without validation): {len(cxf_data)/1024/1024/parse_time_without_validation:.1f} MB/second"
249+
f" Data throughput (without validation): {len(cxf_data) / 1024 / 1024 / parse_time_without_validation:.1f} MB/second"
250250
)
251251

252252
return {

utilities/export_todo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def extract_todo_items(root_directory: str) -> dict:
8181

8282
if in_todo and line.startswith("#"):
8383
todo_item.append(line.replace("#", "").strip())
84-
elif len(todo_item):
84+
elif todo_item:
8585
key = filename.replace("../", "")
8686
if not todo_items.get(key):
8787
todo_items[key] = []

0 commit comments

Comments
 (0)