Skip to content

Cleanup Warnings #1135

@garrettwrong

Description

@garrettwrong

Some of our numerical tools have had major releases and are now triggering some more warnings. I've captured current warnings for 3.10 on caf below.

========================================================= warnings summary ==========================================================
tests/test_FBbasis3D.py: 4 warnings
tests/test_FBbasis2D.py: 70 warnings
tests/test_FLEbasis2D.py: 18 warnings
tests/test_FFBbasis2D.py: 52 warnings
tests/test_FFBbasis3D.py: 4 warnings
tests/test_covar2d_denoiser.py: 664 warnings
tests/test_steerable_bases_2d.py: 10 warnings
tests/test_FPSWFbasis2D.py: 1 warning
tests/test_PSWFbasis2D.py: 1 warning
  /scratch/gbwright/Projects/ASPIRE-Python.np2/src/aspire/basis/basis.py:583: DeprecationWarning: 'scipy.sparse.linalg.cg' keyword argument `tol` is deprecated in favor of `rtol` and will be removed in SciPy v1.14.0. Until then, if set, it will override `rtol`.
    v[isample], info = cg(operator, b, tol=tol, atol=atol)

tests/test_image.py::test_corrupt_mrc_load
  /scratch/gbwright/miniconda3/envs/np2_310/lib/python3.10/site-packages/numpy/core/_methods.py:176: RuntimeWarning: overflow encountered in multiply
    x = um.multiply(x, x, out=x)

tests/test_mean_estimator.py: 24 warnings
tests/test_mean_estimator_boosting.py: 12 warnings
tests/test_weighted_mean_estimator.py: 24 warnings
tests/test_array_image_source.py: 2 warnings
  /scratch/gbwright/Projects/ASPIRE-Python.np2/src/aspire/reconstruction/mean.py:248: DeprecationWarning: 'scipy.sparse.linalg.cg' keyword argument `tol` is deprecated in favor of `rtol` and will be removed in SciPy v1.14.0. Until then, if set, it will override `rtol`.
    x, info = cg(

tests/test_fourier_correlation.py: 32 warnings
tests/test_micrograph_source.py: 8 warnings
tests/test_image.py: 1 warning
tests/test_simulation.py: 3 warnings
  /scratch/gbwright/Projects/ASPIRE-Python.np2/tests/test_utils.py:403: MatplotlibDeprecationWarning: Auto-close()ing of figures upon backend switching is deprecated since 3.8 and will be removed in 3.10.  To suppress this warning, explicitly call plt.close('all') first.
    matplotlib.use(backend)

tests/test_fourier_correlation.py::test_frc_img_plot[img_size=64-dtype=<class 'numpy.float64'>]
tests/test_fourier_correlation.py::test_frc_img_plot[img_size=64-dtype=<class 'numpy.float32'>]
tests/test_fourier_correlation.py::test_frc_img_plot[img_size=65-dtype=<class 'numpy.float64'>]
tests/test_fourier_correlation.py::test_frc_img_plot[img_size=65-dtype=<class 'numpy.float32'>]
tests/test_fourier_correlation.py::test_fsc_vol_plot[img_size=64-dtype=<class 'numpy.float64'>]
tests/test_fourier_correlation.py::test_fsc_vol_plot[img_size=64-dtype=<class 'numpy.float32'>]
tests/test_fourier_correlation.py::test_fsc_vol_plot[img_size=65-dtype=<class 'numpy.float64'>]
tests/test_fourier_correlation.py::test_fsc_vol_plot[img_size=65-dtype=<class 'numpy.float32'>]
  /scratch/gbwright/Projects/ASPIRE-Python.np2/src/aspire/utils/resolution_estimation.py:380: UserWarning: No artists with labels found to put in legend.  Note that artists whose label start with an underscore are ignored when legend() is called with no argument.
    plt.legend(title=f"Method: {self.method}")

tests/test_orient_symmetric.py: 192 warnings
  /scratch/gbwright/Projects/ASPIRE-Python.np2/tests/test_orient_symmetric.py:195: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    dist[i] = Rotation.angle_dist(estimate, Rii_gt)

tests/test_orient_symmetric.py: 2970 warnings
  /scratch/gbwright/Projects/ASPIRE-Python.np2/tests/test_orient_symmetric.py:641: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    clmatrix_gt[idx, i, j] = CLSymmetryC3C4.cl_angles_to_ind(

tests/test_orient_symmetric.py: 2970 warnings
  /scratch/gbwright/Projects/ASPIRE-Python.np2/tests/test_orient_symmetric.py:644: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    clmatrix_gt[idx, j, i] = CLSymmetryC3C4.cl_angles_to_ind(

tests/test_covar2d_denoiser.py: 15 warnings
  /scratch/gbwright/Projects/ASPIRE-Python.np2/src/aspire/basis/steerable.py:524: UserWarning: BlkDiagMatrix.from_dense truncating values exceeding 0.001
    filt = BlkDiagMatrix.from_dense(

tests/test_orient_symmetric.py: 1932 warnings
  /scratch/gbwright/Projects/ASPIRE-Python.np2/tests/test_orient_symmetric.py:158: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    dist[s] = np.minimum(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Most of these look straightforward. After they're completed, should scan 3.9 and 3.11 as well. At this time my 3.8 only reports the internal BlkDiagMatrix.from_dense warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CIContinuous Integrationcleanup

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions