From 3b82dbbb5719ebf6998ab4add4510ed2015d500f Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Fri, 9 Sep 2022 16:01:59 +0800 Subject: [PATCH] docs: update cross reference Signed-off-by: Xuehai Pan --- nvitop/core/device.py | 6 +++--- nvitop/core/libnvml.py | 2 +- nvitop/core/process.py | 2 +- nvitop/gui/screens/main/device.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nvitop/core/device.py b/nvitop/core/device.py index dc9f1c8..aeb7689 100644 --- a/nvitop/core/device.py +++ b/nvitop/core/device.py @@ -552,7 +552,7 @@ class Device: # pylint: disable=too-many-instance-attributes,too-many-public-me uuid: Optional[str] = None, bus_id: Optional[str] = None ) -> None: - """Initializes the instance created by ``__new__()``. + """Initializes the instance created by :meth:`__new__()`. Raises: libnvml.NVMLError_LibraryNotFound: @@ -1878,7 +1878,7 @@ class MigDevice(Device): # pylint: disable=too-many-instance-attributes def __init__( self, index: Optional[Union[Tuple[int, int], str]] = None, *, uuid: Optional[str] = None ) -> None: - """Initializes the instance created by ``__new__()``. + """Initializes the instance created by :meth:`__new__()`. Raises: libnvml.NVMLError_LibraryNotFound: @@ -2191,7 +2191,7 @@ class CudaDevice(Device): nvml_index: Optional[Union[int, Tuple[int, int]]] = None, uuid: Optional[str] = None ) -> None: - """Initializes the instance created by ``__new__()``. + """Initializes the instance created by :meth:`__new__()`. Raises: libnvml.NVMLError_LibraryNotFound: diff --git a/nvitop/core/libnvml.py b/nvitop/core/libnvml.py index a86b7d9..ec00684 100644 --- a/nvitop/core/libnvml.py +++ b/nvitop/core/libnvml.py @@ -284,7 +284,7 @@ def nvmlShutdown() -> None: # pylint: disable=function-redefined If RM detects a driver/library version mismatch, usually after an upgrade for NVIDIA driver without reloading the kernel module. NVMLError_Uninitialized: - If NVML was not first initialized with ``nvmlInit()``. + If NVML was not first initialized with :func:`nvmlInit`. """ global __flags, __initialized # pylint: disable=global-statement,global-variable-not-assigned diff --git a/nvitop/core/process.py b/nvitop/core/process.py index e6bc5e1..a98461d 100644 --- a/nvitop/core/process.py +++ b/nvitop/core/process.py @@ -490,7 +490,7 @@ class GpuProcess: # pylint: disable=too-many-instance-attributes,too-many-publi compute_instance_id: Optional[Union[int, NaType]] = None, type: Optional[Union[str, NaType]] = None, # pylint: disable=redefined-builtin ) -> None: - """Initializes the instance returned by ``__new__()``.""" + """Initializes the instance returned by :meth:`__new__()`.""" if gpu_memory is None and not hasattr(self, '_gpu_memory'): gpu_memory = NA diff --git a/nvitop/gui/screens/main/device.py b/nvitop/gui/screens/main/device.py index 5c9a67b..a60a4c4 100644 --- a/nvitop/gui/screens/main/device.py +++ b/nvitop/gui/screens/main/device.py @@ -152,7 +152,7 @@ class DevicePanel(Displayable): # pylint: disable=too-many-instance-attributes ) device.mig_mode = device.mig_mode.replace('N/A', 'N/A ') device.compute_mode = device.compute_mode.replace('Exclusive', 'E.') - if device.fan_speed >= 100: + if device.fan_speed is not NA and device.fan_speed >= 100: device.fan_speed_string = 'MAX' with self.snapshot_lock: