MoseleyBioinformaticsLab / gpu_tracker

Context manager and CLI that tracks the computational-resource-usage of a code block or shell command, particularly the GPU usage.
Other
4 stars 1 forks source link

`__str__` raises an exception when the measurements are still None #10

Closed erikhuck closed 3 months ago

erikhuck commented 3 months ago

The resource usage measurements are None when the Tracker is first initialized. So an exception is raised when a user attempts to call __str__ via str(tracker). There should be more explanation than None type does not have attribute .... If the measurements are None, the __str__ method should not crash but rather the content of the string should indicate that tracking has not yet begun.