Skip to content

Privatize system.Device helper classes#1942

Merged
rwgk merged 1 commit intomainfrom
privatize-system-helper-classes
Apr 20, 2026
Merged

Privatize system.Device helper classes#1942
rwgk merged 1 commit intomainfrom
privatize-system-helper-classes

Conversation

@mdboom
Copy link
Copy Markdown
Contributor

@mdboom mdboom commented Apr 17, 2026

Also fixes #1941.

Remove helper/data-container classes from cuda.core.system's public API (__all__) since they are not intended to be directly instantiated by users. These classes are returned by Device properties/methods and serve as nested data containers.

Classes removed from __all__: BAR1MemoryInfo, ClockInfo, ClockOffsets, CoolerInfo, DeviceAttributes, DeviceEvents, EventData, FanInfo, FieldValue, FieldValues, GpuDynamicPstatesInfo, GpuDynamicPstatesUtilization, InforomInfo, PciInfo, RepairStatus, Temperature, ThermalSensor, ThermalSettings.

Enums, exceptions, Device itself, and free functions remain public.

Changes

  • Remove helper classes from __all__ in _device.pyx
  • Update api.rst to document helper classes via their private module path (system._device.ClassName)
  • Update Device property/method docstrings to link to helper classes using :obj: role
  • Update tests to import helper classes from _device module

@mdboom mdboom added this to the cuda.core next milestone Apr 17, 2026
@mdboom mdboom added the cuda.core Everything related to the cuda.core module label Apr 17, 2026
@mdboom mdboom self-assigned this Apr 17, 2026
@github-actions

This comment has been minimized.

Remove helper/data-container classes from cuda.core.system's public API
(__all__) since they are not intended to be directly instantiated by
users. These classes are returned by Device properties/methods and serve
as nested data containers.

Classes removed from __all__: BAR1MemoryInfo, ClockInfo, ClockOffsets,
CoolerInfo, DeviceAttributes, DeviceEvents, EventData, FanInfo,
FieldValue, FieldValues, GpuDynamicPstatesInfo,
GpuDynamicPstatesUtilization, InforomInfo, PciInfo, RepairStatus,
Temperature, ThermalSensor, ThermalSettings.

Enums, exceptions, Device itself, and free functions remain public.

Also:
- Update api.rst to document helper classes via their private module
  path (system._device.ClassName)
- Update Device property/method docstrings to link to helper classes
  using :obj:`~ClassName` role
- Update tests to import helper classes from _device module
@mdboom mdboom force-pushed the privatize-system-helper-classes branch from 3bea34c to f3ab66a Compare April 17, 2026 18:07
@mdboom mdboom requested a review from cpcloud April 20, 2026 15:36
@rwgk rwgk added the P0 High priority - Must do! label Apr 20, 2026
@rwgk rwgk merged commit b427919 into main Apr 20, 2026
154 of 156 checks passed
@rwgk rwgk deleted the privatize-system-helper-classes branch April 20, 2026 23:16
@rwgk
Copy link
Copy Markdown
Contributor

rwgk commented Apr 20, 2026

(I only glanced through. LGTM)

@github-actions
Copy link
Copy Markdown

Doc Preview CI
Preview removed because the pull request was closed or merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.core Everything related to the cuda.core module P0 High priority - Must do!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOCS: properties do not link to their type

3 participants