termgraph
termgraph copied to clipboard
ValueError: math domain error if value == 0
If termgraph is used as a module and a value is 0, a ValueError: math domain error is thrown by math.log in utils.py::cvt_to_readable(num) here:
https://github.com/mkaz/termgraph/blob/09e17cc3510b62969fc12075dd698817357a5a93/termgraph/utils.py#L16
Problem is that there is there is no zero check for num. This is done correctly in termgraph.py::cvt_to_readable(num):
https://github.com/mkaz/termgraph/blob/4aa3b6711136fb0232bf149a64afa4b49c2b28f3/termgraph/termgraph.py#L197
I made a pull request to fix this.