-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
Description
It appears recent updates to Numpy are now emitting some UserWarnings for calls using where= arg for masking. See for example:
/scratch/gbwright/Projects_2025/SymMol_ClsAvgs/10061/ASPIRE-Python.fix_mrc_src/src/aspire/utils/matrix.py:367: UserWarning: 'where' used without 'out', expect unitialized memory in output. If this is intentional, use out=None.
signs = np.divide(_abs, signs, where=_abs != 0)
/scratch/gbwright/Projects_2025/SymMol_ClsAvgs/10061/ASPIRE-Python.fix_mrc_src/src/aspire/classification/legacy_implementations.py:148: UserWarning: 'where' used without 'out', expect unitialized memory in output. If this is intentional, use out=None.
m = np.exp(o1 * np.log(p, where=(mask > 0)))
The warnings are reasonable concern. In those cases above I expect the input arrays to already be packed with values. (We are generally using just for masking extremal vals etc).
Numpy suggests an easy fix. This would also be a good time to review any other places we're using the where argument to confirm it is operating as intended.