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

stack raises error when stacking signals that contain a variance signal #2954

Merged
merged 5 commits into from Jun 16, 2022

Conversation

francisco-dlp
Copy link
Member

Progress of the PR

  • Change implemented (can be split into several points),
  • 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

The following raises an error without this fix:

import hyperspy.api as hs
import numpy as np

s = hs.signals.EELSSpectrum(np.random.random((10, 10, 100)))
s.axes_manager[0].name = "x"
s.axes_manager[1].name = "y"
s.estimate_poissonian_noise_variance()
hs.stack([s, s], axis="y")

@codecov
Copy link

codecov bot commented Jun 8, 2022

Codecov Report

Merging #2954 (c66daa3) into RELEASE_next_patch (3634a16) will decrease coverage by 0.06%.
The diff coverage is 100.00%.

@@                  Coverage Diff                   @@
##           RELEASE_next_patch    #2954      +/-   ##
======================================================
- Coverage               80.87%   80.80%   -0.07%     
======================================================
  Files                     209      209              
  Lines                   32654    32698      +44     
  Branches                 7313     7322       +9     
======================================================
+ Hits                    26408    26421      +13     
- Misses                   4483     4514      +31     
  Partials                 1763     1763              
Impacted Files Coverage Δ
hyperspy/misc/utils.py 91.00% <ø> (+0.46%) ⬆️
hyperspy/axes.py 91.18% <100.00%> (+0.01%) ⬆️
hyperspy/samfire_utils/samfire_worker.py 65.42% <0.00%> (-19.16%) ⬇️
hyperspy/misc/eels/base_gos.py 35.00% <0.00%> (-1.59%) ⬇️
hyperspy/model.py 83.80% <0.00%> (-0.21%) ⬇️
hyperspy/interactive.py 86.79% <0.00%> (ø)
hyperspy/_signals/eds.py 85.56% <0.00%> (ø)
hyperspy/_signals/eels.py 77.43% <0.00%> (ø)
hyperspy/misc/elements.py 100.00% <0.00%> (ø)
hyperspy/_signals/eds_sem.py 60.60% <0.00%> (ø)
... and 12 more

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 3634a16...c66daa3. Read the comment docs.

@ericpre ericpre changed the base branch from RELEASE_next_minor to RELEASE_next_patch June 8, 2022 16:36
Copy link
Contributor

@jlaehne jlaehne left a comment

Choose a reason for hiding this comment

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

otherwise, lgtm

hyperspy/axes.py Show resolved Hide resolved
Copy link
Member

@ericpre ericpre left a comment

Choose a reason for hiding this comment

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

Other than adding a test, as mentioned by @jlaehne, it looks good!

@ericpre ericpre merged commit 6981138 into hyperspy:RELEASE_next_patch Jun 16, 2022
@francisco-dlp francisco-dlp deleted the FIX_stack branch June 21, 2022 09:21
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

3 participants