Skip to content
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

Fix image comparison following numpy 1.21.0 release #2786

Merged
merged 2 commits into from Jun 30, 2021

Conversation

ericpre
Copy link
Member

@ericpre ericpre commented Jun 30, 2021

I could not find what changes, but numpy 1.21.0 changes the log norm of matplotlib and it makes one of the plotting test fail. I had to change the test and the reference images so that it works for both version of numpy. The new behaviour is correct: zero values are masked when taking the log norm.

Progress of the PR

  • Update test to pass with numpy < 1.21 and numpy 1.21
  • add an changelog entry in the upcoming_changes folder (see upcoming_changes/README.rst),
  • Check formatting changelog entry in the readthedocs doc build of this PR (link in github checks)
  • add tests,
  • ready for review.

Minimal example of the bug fix or the new feature

import hyperspy.api as hs
import numpy as np

s = hs.signals.Signal2D(np.arange(10*10).reshape(10, 10))
s -= 50
s.plot(norm='log')

@codecov
Copy link

codecov bot commented Jun 30, 2021

Codecov Report

Merging #2786 (5eccdb2) into RELEASE_next_patch (7fed9b2) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           RELEASE_next_patch    #2786   +/-   ##
===================================================
  Coverage               77.36%   77.36%           
===================================================
  Files                     202      202           
  Lines                   30105    30105           
  Branches                 6579     6579           
===================================================
  Hits                    23290    23290           
  Misses                   5067     5067           
  Partials                 1748     1748           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7fed9b2...5eccdb2. Read the comment docs.

@jlaehne jlaehne merged commit 3a07064 into hyperspy:RELEASE_next_patch Jun 30, 2021
@ericpre ericpre deleted the fix_image_comparison branch July 1, 2021 18:43
@ericpre ericpre added this to the 1.6.4 milestone Jul 8, 2021
@ericpre ericpre modified the milestones: 1.6.4, v1.6.5 Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants