-
Notifications
You must be signed in to change notification settings - Fork 26
Remove Warnings #1170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Warnings #1170
Conversation
838ffe8 to
d9e9981
Compare
|
I've resolved all warnings for Python 3.8 - 3.11. There are 2 remaining warnings on the ampere job. One is related to an external package not importing a |
garrettwrong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not fix all the errors? We should be able to fix both the remaining ones you mentioned pretty easily to make this whole.
Also, we seem to be missing the part about putting new warnings under test so the CI indicates we have warnings to address.
Good point. Fixed those remaining warnings.
|
|
@garrettwrong as discussed in meeting, I've changed this to fail on warnings for the ampere job only. This should be good to go now. Thanks. |
garrettwrong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good thanks! Just two questions and it can move on.
garrettwrong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
a515538 to
17e615c
Compare
janden
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just one question, really.
h ndim > 0 to a scalar is deprecated, by returning scalar for single value returns
…ty for test images.
…instead of np.empty.
…empty's with ones.
17e615c to
9a0afa9
Compare
|
Had to resolve a conflict related to purging |
This PR resolves warning messages emitted during unit testing.
Python 3.8:
tests/test_sinogram.py: 12 warnings
/scratch/jc5485/miniconda3/envs/warnings_3.8/lib/python3.8/site-packages/skimage/transform/radon_transform.py:75: UserWarning: Radon transform: image must be zero outside the reconstruction circle
warn('Radon transform: image must be zero outside the '
tests/test_covar2d_denoiser.py: 15 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.8/src/aspire/basis/steerable.py:524: UserWarning: BlkDiagMatrix.from_dense truncating values exceeding 0.001
filt = BlkDiagMatrix.from_dense(
Python 3.9:
tests/test_FFBbasis2D.py: 52 warnings
tests/test_FBbasis2D.py: 70 warnings
tests/test_FFBbasis3D.py: 4 warnings
tests/test_FLEbasis2D.py: 18 warnings
tests/test_FBbasis3D.py: 4 warnings
tests/test_covar2d_denoiser.py: 664 warnings
tests/test_mean_estimator.py: 24 warnings
tests/test_mean_estimator_boosting.py: 11 warnings
tests/test_steerable_bases_2d.py: 10 warnings
tests/test_FPSWFbasis2D.py: 1 warning
tests/test_PSWFbasis2D.py: 1 warning
tests/test_weighted_mean_estimator.py: 24 warnings
tests/test_array_image_source.py: 2 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.9/src/aspire/numeric/scipy.py:17: DeprecationWarning: 'scipy.sparse.linalg.cg' keyword argument
tolis deprecated in favor ofrtoland will be removed in SciPy v1.14.0. Until then, if set, it will overridertol.return scipy.sparse.linalg.cg(*args, **kwargs)
tests/test_fourier_correlation.py: 32 warnings
tests/test_image.py: 1 warning
tests/test_micrograph_source.py: 8 warnings
tests/test_simulation.py: 3 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.9/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_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_frc_img_plot[img_size=65-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/jc5485/Work/ASPIRE-python.warnings_3.9/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 argumen
t.
plt.legend(title=f"Method: {self.method}")
tests/test_micrograph_source.py::test_rectangular_micrograph_source_files
/scratch/jc5485/miniconda3/envs/warnings_3.9/lib/python3.9/site-packages/mrcfile/mrcobject.py:626: RuntimeWarning: Data array contains NaN values
warnings.warn("Data array contains NaN values", RuntimeWarning)
tests/test_sinogram.py: 60 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.9/src/aspire/image/image.py:243: DeprecationWarning:
productis deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please useprodinstead.return aspire.sinogram.Sinogram(xp.asnumpy(image_rt))
tests/test_sinogram.py: 20 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.9/src/aspire/sinogram/sinogram.py:62: DeprecationWarning:
productis deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please useprodinstead.return self.class(self._data[key])
tests/test_sinogram.py: 22 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.9/src/aspire/sinogram/sinogram.py:90: DeprecationWarning:
productis deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please useprodinstead.return self.class(self._data.reshape(*shape, *self._data.shape[-2:]))
tests/test_sinogram.py: 12 warnings
/scratch/jc5485/miniconda3/envs/warnings_3.9/lib/python3.9/site-packages/skimage/transform/radon_transform.py:74: UserWarning: Radon transform: image must be zero outside the reconstruction circle
warn(
tests/test_covar2d_denoiser.py: 15 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.9/src/aspire/basis/steerable.py:524: UserWarning: BlkDiagMatrix.from_dense truncatin
g values exceeding 0.001
filt = BlkDiagMatrix.from_dense(
tests/test_orient_symmetric.py: 2970 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.9/tests/test_orient_symmetric.py:641: DeprecationWarning: Conversion of an array wit
h ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performin
g this operation. (Deprecated NumPy 1.25.)
clmatrix_gt[idx, i, j] = CLSymmetryC3C4.cl_angles_to_ind(
tests/test_orient_symmetric.py: 2970 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.9/tests/test_orient_symmetric.py:644: DeprecationWarning: Conversion of an array wit
h ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performin
g this operation. (Deprecated NumPy 1.25.)
clmatrix_gt[idx, j, i] = CLSymmetryC3C4.cl_angles_to_ind(
tests/test_orient_symmetric.py: 1932 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.9/tests/test_orient_symmetric.py:158: DeprecationWarning: Conversion of an array wit
h ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performin
g this operation. (Deprecated NumPy 1.25.)
dist[s] = np.minimum(
tests/test_orient_symmetric.py: 192 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.9/tests/test_orient_symmetric.py:195: DeprecationWarning: Conversion of an array wit
h ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performin
g this operation. (Deprecated NumPy 1.25.)
dist[i] = Rotation.angle_dist(estimate, Rii_gt)
Python 3.10:
tests/test_fourier_correlation.py: 32 warnings
tests/test_image.py: 1 warning
tests/test_micrograph_source.py: 8 warnings
tests/test_simulation.py: 3 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.10/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('a
ll') 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/jc5485/Work/ASPIRE-python.warnings_3.10/src/aspire/utils/resolution_estimation.py:380: UserWarning: No artists with label
s found to put in legend. Note that artists whose label start with an underscore are ignored when legend() is called with no argume
nt.
plt.legend(title=f"Method: {self.method}")
tests/test_sinogram.py: 60 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.10/src/aspire/image/image.py:243: DeprecationWarning:
productis deprecated as ofNumPy 1.25.0, and will be removed in NumPy 2.0. Please use
prodinstead.return aspire.sinogram.Sinogram(xp.asnumpy(image_rt))
tests/test_sinogram.py: 20 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.10/src/aspire/sinogram/sinogram.py:62: DeprecationWarning:
productis deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use
prodinstead.return self.class(self._data[key])
tests/test_sinogram.py: 22 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.10/src/aspire/sinogram/sinogram.py:90: DeprecationWarning:
productis deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use
prodinstead.return self.class(self._data.reshape(*shape, *self._data.shape[-2:]))
tests/test_sinogram.py: 12 warnings
/scratch/jc5485/miniconda3/envs/warnings_3.10/lib/python3.10/site-packages/skimage/transform/radon_transform.py:74: UserWarning: R
adon transform: image must be zero outside the reconstruction circle
warn(
tests/test_covar2d_denoiser.py: 15 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.10/src/aspire/basis/steerable.py:524: UserWarning: BlkDiagMatrix.from_dense truncati
ng values exceeding 0.001
filt = BlkDiagMatrix.from_dense(
tests/test_orient_symmetric.py: 1932 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.10/tests/test_orient_symmetric.py:158: DeprecationWarning: Conversion of an array wi
th ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performi
ng this operation. (Deprecated NumPy 1.25.)
dist[s] = np.minimum(
tests/test_orient_symmetric.py: 192 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.10/tests/test_orient_symmetric.py:195: DeprecationWarning: Conversion of an array wi
th ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performi
ng this operation. (Deprecated NumPy 1.25.)
dist[i] = Rotation.angle_dist(estimate, Rii_gt)
tests/test_orient_symmetric.py: 2970 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.10/tests/test_orient_symmetric.py:641: DeprecationWarning: Conversion of an array wi
th ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performi
ng this operation. (Deprecated NumPy 1.25.)
clmatrix_gt[idx, i, j] = CLSymmetryC3C4.cl_angles_to_ind(
tests/test_orient_symmetric.py: 2970 warnings
/scratch/jc5485/Work/ASPIRE-python.warnings_3.10/tests/test_orient_symmetric.py:644: DeprecationWarning: Conversion of an array wi
th ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performi
ng this operation. (Deprecated NumPy 1.25.)
clmatrix_gt[idx, j, i] = CLSymmetryC3C4.cl_angles_to_ind(