rerun formatting with ruff 0.9.1 (#3569)

rerun with ruff 0.9.1
This commit is contained in:
Justin Kerr authored and GitHub committed 2025-01-13 10:46:11 -08:00
1 parent 5be513e968
commit 66cd6817f9
29 files changed
+92 -92

No files matched your search

+3 -3
View File
@@ -42,9 +42,9 @@ def get_local_rank() -> int:
"""The rank of the current process within the local (per-machine) process group."""
if not is_dist_avail_and_initialized():
return 0
assert (
LOCAL_PROCESS_GROUP is not None
), "Local process group is not created! Please use launch() to spawn processes!"
assert LOCAL_PROCESS_GROUP is not None, (
"Local process group is not created! Please use launch() to spawn processes!"
)
return dist.get_rank(group=LOCAL_PROCESS_GROUP)
+3 -3
View File
@@ -71,9 +71,9 @@ class TensorDataclass:
set _shape to be the broadcasted shape.
"""
for k, v in self._field_custom_dimensions.items():
assert (
isinstance(v, int) and v > 1
), f"Custom dimensions must be an integer greater than 1, since 1 is the default, received {k}: {v}"
assert isinstance(v, int) and v > 1, (
f"Custom dimensions must be an integer greater than 1, since 1 is the default, received {k}: {v}"
)
# Shim to prevent pyright from narrowing `self` to DataclassInstance.
self_dc = self
+1 -1
View File
@@ -503,7 +503,7 @@ class LocalWriter:
"""
step = GLOBAL_BUFFER["step"]
fraction_done = step / GLOBAL_BUFFER["max_iter"]
curr_mssg = f"{step} ({fraction_done*100:.02f}%)"
curr_mssg = f"{step} ({fraction_done * 100:.02f}%)"
curr_mssg = f"{curr_mssg:<20}"
for name, v in latest_map.items():
if name in self.stats_to_track: