pylinac
pylinac copied to clipboard
CatPhan Regression - Runtime Warning
Error Message
/home/crcrewso/venv/pylinactest/lib64/python3.8/site-packages/numpy/core/fromnumeric.py:3334: RuntimeWarning: Mean of empty slice.
return _methods._mean(a, axis=axis, dtype=dtype,
/home/crcrewso/venv/pylinactest/lib64/python3.8/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
/home/crcrewso/venv/pylinactest/lib64/python3.8/site-packages/numpy/core/_methods.py:216: RuntimeWarning: Degrees of freedom <= 0 for slice
ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof,
/home/crcrewso/venv/pylinactest/lib64/python3.8/site-packages/numpy/core/_methods.py:185: RuntimeWarning: invalid value encountered in true_divide
arrmean = um.true_divide(
/home/crcrewso/venv/pylinactest/lib64/python3.8/site-packages/numpy/core/_methods.py:209: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
Describe the Bug Warning from numpy about mean of empty slice
To Reproduce Steps to reproduce the behavior:
- Install master version of pylinac with currently listed dependancies
- run CT analysis on Dataset
- See error
- Analysis continues with what appears to be accurate results
Expected behavior No warning message
You can filter them (e.g. https://stackoverflow.com/questions/29347987/why-cant-i-suppress-numpy-warnings) or upgrade numpy.
See if Randy's fix removes these for you: https://github.com/jrkerns/pylinac/pull/355.