[PR #132] [MERGED] fix(collector): fix documentation for ResourceMetricCollector.clear() function #170

Closed
opened 2026-05-05 03:27:12 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/XuehaiPan/nvitop/pull/132
Author: @MyGodItsFull0fStars
Created: 7/22/2024
Status: Merged
Merged: 8/7/2024
Merged by: @XuehaiPan

Base: mainHead: fix-documentation


📝 Commits (5)

  • 83a2d0b Fixed documentation for ResourceMetricCollector.clear() method
  • d62e256 Added reset alias for ResourceMetricCollector clear() function
  • ca6c30f style: run pre-commit hooks
  • 56a51d4 Merge branch 'main' into pr/MyGodItsFull0fStars/132
  • 1214010 docs(CHANGELOG): update CHANGELOG.md

📊 Changes

2 files changed (+10 additions, -7 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 nvitop/api/collector.py (+9 -7)

📄 Description

The docstrings of ResourceMetricCollector referred to the clear() function as reset(), which is not existing.
Therefore, I replaced each mention of reset() with clear() in the documentation.

Issue Type

  • Improvement/feature implementation

Runtime Environment

  • Operating system and version: [e.g. Ubuntu 20.04 LTS / Windows 10 Build 19043.1110]
  • Terminal emulator and version: [e.g. GNOME Terminal 3.36.2 / Windows Terminal 1.8.1521.0]
  • Python version: [e.g. 3.7.2 / 3.9.6]
  • NVML version (driver version): [e.g. 460.84]
  • nvitop version or commit: [e.g. 0.10.0 / 0.10.1.dev7+ga083321 / main@75ae3c]
  • python-ml-py version: [e.g. 11.450.51]
  • Locale: [e.g. C / C.UTF-8 / en_US.UTF-8]

Description

Within the ResourceMetricCollector class, the clear() function was not used in the documentation for the class, nor the docstring of the function itself, but reset().

As the reset() function is not existing for ResourceMetricCollector, I replaced all occurrences of it in the documentation with clear() as well as changing the description of the clear() function to reflect it's name better.

Motivation and Context

The motivation is, that I was looking at the documentation and tried to use the reset() function for a ResourceMetricCollector instance, and encountered an error.
I had to look at the code to see that the function I have to use is called clear().

Testing

As I only changed the docstrings within the ResourceMetricCollector class, I did not test my changes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/XuehaiPan/nvitop/pull/132 **Author:** [@MyGodItsFull0fStars](https://github.com/MyGodItsFull0fStars) **Created:** 7/22/2024 **Status:** ✅ Merged **Merged:** 8/7/2024 **Merged by:** [@XuehaiPan](https://github.com/XuehaiPan) **Base:** `main` ← **Head:** `fix-documentation` --- ### 📝 Commits (5) - [`83a2d0b`](https://github.com/XuehaiPan/nvitop/commit/83a2d0b6569c478e444deccecf8b449d0d2e69e6) Fixed documentation for `ResourceMetricCollector.clear()` method - [`d62e256`](https://github.com/XuehaiPan/nvitop/commit/d62e2562de60664995bf16c421459879fe8a6eaf) Added reset alias for ResourceMetricCollector clear() function - [`ca6c30f`](https://github.com/XuehaiPan/nvitop/commit/ca6c30faa4e60a97fc7c14a2e6c17ababeca1d07) style: run pre-commit hooks - [`56a51d4`](https://github.com/XuehaiPan/nvitop/commit/56a51d4705fd02a1759c4e8322836457541e1c2f) Merge branch 'main' into pr/MyGodItsFull0fStars/132 - [`1214010`](https://github.com/XuehaiPan/nvitop/commit/121401087f05ecef5eeb253951888af9a545b995) docs(CHANGELOG): update CHANGELOG.md ### 📊 Changes **2 files changed** (+10 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `nvitop/api/collector.py` (+9 -7) </details> ### 📄 Description The docstrings of `ResourceMetricCollector` referred to the `clear()` function as `reset()`, which is not existing. Therefore, I replaced each mention of `reset()` with `clear()` in the documentation. #### Issue Type - Improvement/feature implementation #### Runtime Environment - Operating system and version: [e.g. Ubuntu 20.04 LTS / Windows 10 Build 19043.1110] - Terminal emulator and version: [e.g. GNOME Terminal 3.36.2 / Windows Terminal 1.8.1521.0] - Python version: [e.g. `3.7.2` / `3.9.6`] - NVML version (driver version): [e.g. `460.84`] - `nvitop` version or commit: [e.g. `0.10.0` / `0.10.1.dev7+ga083321` / `main@75ae3c`] - `python-ml-py` version: [e.g. `11.450.51`] - Locale: [e.g. `C` / `C.UTF-8` / `en_US.UTF-8`] #### Description Within the `ResourceMetricCollector` class, the `clear()` function was not used in the documentation for the class, nor the docstring of the function itself, but `reset()`. As the `reset()` function is not existing for `ResourceMetricCollector`, I replaced all occurrences of it in the documentation with `clear()` as well as changing the description of the `clear()` function to reflect it's name better. #### Motivation and Context <!-- Why are these changes required? --> <!-- What problems do these changes solve? --> <!-- Link to relevant issues --> The motivation is, that I was looking at the documentation and tried to use the `reset()` function for a `ResourceMetricCollector` instance, and encountered an error. I had to look at the code to see that the function I have to use is called `clear()`. #### Testing As I only changed the docstrings within the `ResourceMetricCollector` class, I did not test my changes. <!-- What tests have been run? --> <!-- How does the changes affect other areas of the codebase? --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 03:27:12 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/nvitop#170
No description provided.