Skip to content

Commit 5efbe4e

Browse files
committed
style(cuda.core): apply ruff format
Collapses multi-line string concats and conditions back to single lines under the project's line-length limit. No behavior change.
1 parent 1b66367 commit 5efbe4e

3 files changed

Lines changed: 3 additions & 8 deletions

File tree

cuda_core/cuda/core/_host.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ class Host:
3636
_instances_lock: ClassVar[threading.Lock] = threading.Lock()
3737

3838
def __new__(cls, numa_id: int | None = None) -> Host:
39-
if numa_id is not None and (
40-
isinstance(numa_id, bool) or not isinstance(numa_id, int) or numa_id < 0
41-
):
39+
if numa_id is not None and (isinstance(numa_id, bool) or not isinstance(numa_id, int) or numa_id < 0):
4240
raise ValueError(f"numa_id must be a non-negative int, got {numa_id!r}")
4341
return cls._get_or_create(numa_id, is_numa_current=False)
4442

cuda_core/cuda/core/_memory/_managed_buffer.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,7 @@ def accessed_by(self, locations) -> None:
212212
target: set[Device | Host] = set()
213213
for loc in locations:
214214
if not isinstance(loc, (Device, Host)):
215-
raise TypeError(
216-
f"accessed_by entries must be Device or Host, got {type(loc).__name__}"
217-
)
215+
raise TypeError(f"accessed_by entries must be Device or Host, got {type(loc).__name__}")
218216
target.add(loc)
219217
current = set(_query_accessed_by(self))
220218
for loc in current - target:

cuda_core/cuda/core/_memory/_managed_location.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ def _reject_numa_host_on_cuda12(spec: _LocSpec) -> None:
3838
return
3939
if spec.kind in ("host_numa", "host_numa_current"):
4040
raise TypeError(
41-
"Host(numa_id=...) / Host.numa_current() require a CUDA 13 "
42-
"build of cuda.core; use Host() on CUDA 12"
41+
"Host(numa_id=...) / Host.numa_current() require a CUDA 13 build of cuda.core; use Host() on CUDA 12"
4342
)
4443

4544

0 commit comments

Comments
 (0)