Draft: Fix bug in losoto interpolate (RAP-97)
Current runs with recent numpy cause the following error:
/usr/local/lib/python3.8/dist-packages/losoto/operations/interpolate.py:149: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you m
ust specify 'dtype=object' when creating the ndarray.
new_vals[selection] = np.interp(new_axisvals, orig_axisvals[unflagged],
Traceback (most recent call last):
File "/usr/local/bin/losoto", line 154, in <module>
returncode += ops[ op ]._run_parser( soltab, parser, step )
File "/usr/local/lib/python3.8/dist-packages/losoto/operations/interpolate.py", line 18, in _run_parser
return run( soltab, outSoltab, axisToRegrid, newDelta, delta, maxFlaggedWidth, log)
File "/usr/local/lib/python3.8/dist-packages/losoto/operations/interpolate.py", line 149, in run
new_vals[selection] = np.interp(new_axisvals, orig_axisvals[unflagged],
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
This needs to be fixed. See also issue #14 (closed).
Edited by alex