Closed vc1492a closed 4 years ago
A unit test has been written in a separate library to ensure that the progress bar is exhibiting the proper behavior when utilized, and can be included as part of the patch for this issue.
Added as part of version 0.3.3
.
The below line contained within
PyNomaly/loop.py
fails with a ZeroDivisionError when the total number of observations is less than the terminal or cell width where the code was executed.https://github.com/vc1492a/PyNomaly/blob/744fa57fde27f369f6265ffe57ecb3db3d3374ea/PyNomaly/loop.py#L36
The cause is a block_size of 0, which is not allowable with the current implementation.
This can be resolved by changing the code to the following:
Which will ensure the block_size remains greater than 0 even when the number of observations is less than the width of the terminal / cell window.