Skip to content

Conversation

@j-c-c
Copy link
Collaborator

@j-c-c j-c-c commented Oct 1, 2024

After updating my conda installation to the M1 version I came across a couple test failures and warnings:

FAILED tests/test_FLEbasis2D.py::TestFLEBasis2D::testFastVDense_T[32-1e-14] - assert 1.2014224262161716e-14 < (1.2 * 1e-14)
FAILED tests/test_FLEbasis2D.py::TestFLEBasis2D::testFastVDense[32-1e-14] - assert 1.2593864071972545e-14 < (1.2 * 1e-14)
FAILED tests/test_FLEbasis2D.py::TestFLEBasis2D::testFastVDense[33-1e-14] - assert 1.2064917977487149e-14 < (1.2 * 1e-14)
tests/test_fourier_correlation.py: 32 warnings
  /Users/carmichael/Work/ASPIRE-python.test_arm/src/aspire/utils/resolution_estimation.py:387: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown
    plt.show()

tests/test_image.py: 1 warning
tests/test_micrograph_source.py: 8 warnings
tests/test_simulation.py: 3 warnings
  /Users/carmichael/Work/ASPIRE-python.test_arm/src/aspire/image/image.py:691: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown
    plt.show()

This PR resolves all the warnings and failed tests for Python 3.8-3.11 on the arm platform (aside from the numpy.distutils deprecation warning related to an external package).

@j-c-c j-c-c added CI Continuous Integration cleanup labels Oct 1, 2024
@j-c-c j-c-c self-assigned this Oct 1, 2024
Comment on lines +400 to +403
# Ignore the specific UserWarning about non-interactive FigureCanvasAgg
warnings.filterwarnings(
"ignore", r"FigureCanvasAgg is non-interactive, and thus cannot be shown"
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just filtered out the additional warning but another option would be to override plt.show to be a no-op
in this context or to save the non-gui plot that is generated instead of attempting to show, then restore the plt.show on exit.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be good enough, thanks.

@j-c-c j-c-c requested a review from garrettwrong October 1, 2024 19:58
Comment on lines +400 to +403
# Ignore the specific UserWarning about non-interactive FigureCanvasAgg
warnings.filterwarnings(
"ignore", r"FigureCanvasAgg is non-interactive, and thus cannot be shown"
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be good enough, thanks.

@garrettwrong garrettwrong marked this pull request as ready for review October 1, 2024 20:35
@garrettwrong garrettwrong requested a review from janden as a code owner October 1, 2024 20:35
@garrettwrong
Copy link
Collaborator

I'm just going to merge this in so we can have just the shifts and Swt patches outstanding.

@garrettwrong garrettwrong merged commit 13d4c6f into develop Oct 2, 2024
42 checks passed
@garrettwrong garrettwrong deleted the arm_updates branch October 2, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants