pylinac icon indicating copy to clipboard operation
pylinac copied to clipboard

CatPhan Regression - Runtime Warning

Open crcrewso opened this issue 5 years ago • 2 comments

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:

  1. Install master version of pylinac with currently listed dependancies
  2. run CT analysis on Dataset
  3. See error
  4. Analysis continues with what appears to be accurate results

Expected behavior No warning message

crcrewso avatar May 24 '20 17:05 crcrewso

You can filter them (e.g. https://stackoverflow.com/questions/29347987/why-cant-i-suppress-numpy-warnings) or upgrade numpy.

jrkerns avatar Jun 29 '20 18:06 jrkerns

See if Randy's fix removes these for you: https://github.com/jrkerns/pylinac/pull/355.

jrkerns avatar Apr 05 '21 19:04 jrkerns