Skip to content

Commit b280b9d

Browse files
cuda.core: rename HostCallbackNode.callback_fn to callback (#2024)
Drops the redundant `_fn` suffix on the lone property of `HostCallbackNode`, completing the agreed-upon item from the v1.0.0 naming audit (#1945). Surface is tiny: one Cython property, its docstring entry, and one test assertion key. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent b1d011c commit b280b9d

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

cuda_core/cuda/core/graph/_subclasses.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ cdef class HostCallbackNode(GraphNode):
573573
574574
Properties
575575
----------
576-
callback_fn : callable or None
576+
callback : callable or None
577577
The Python callable (None for ctypes function pointer callbacks).
578578
"""
579579

@@ -613,7 +613,7 @@ cdef class HostCallbackNode(GraphNode):
613613
f" cfunc=0x{<uintptr_t>self._fn:x}>")
614614

615615
@property
616-
def callback_fn(self):
616+
def callback(self):
617617
"""The Python callable, or None for ctypes function pointer callbacks."""
618618
return self._callable
619619

cuda_core/docs/source/release/1.0.0-notes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ Breaking changes
9090
- New: ``kernel.attributes.num_regs`` and
9191
``kernel.attributes[some_dev].num_regs``
9292

93+
- Renamed :attr:`graph.HostCallbackNode.callback_fn` to
94+
:attr:`graph.HostCallbackNode.callback` to drop the redundant ``_fn`` suffix
95+
(`#1945 <https://github.com/NVIDIA/cuda-python/issues/1945>`__).
96+
9397
- Unified the conditional graph API on :class:`~graph.GraphCondition`
9498
and consistent verbs
9599
(`#1945 <https://github.com/NVIDIA/cuda-python/issues/1945>`__):

cuda_core/tests/graph/test_graph_definition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def my_callback():
386386

387387
node = g.callback(my_callback)
388388
return node, {
389-
"callback_fn": lambda v: v is my_callback,
389+
"callback": lambda v: v is my_callback,
390390
}
391391

392392

0 commit comments

Comments
 (0)