Skip to content

Remove duplicate call to update_header#8563

Merged
pllim merged 2 commits intoastropy:masterfrom
saimn:fits-scale-uint
Apr 10, 2019
Merged

Remove duplicate call to update_header#8563
pllim merged 2 commits intoastropy:masterfrom
saimn:fits-scale-uint

Conversation

@saimn
Copy link
Contributor

@saimn saimn commented Apr 9, 2019

See https://github.com/astropy/astropy/pull/5053/files#r66576117

I stumbled upon this while looking at #5559, update_header is called twice (it is called in the .data setter).

@bsipocz
Copy link
Member

bsipocz commented Apr 9, 2019

Is this backportable?

@saimn
Copy link
Contributor Author

saimn commented Apr 9, 2019

Most likely yes, it is just one line, and #5053 came in v1.2 so it should be fine to backport to 2.0.

@codecov
Copy link

codecov bot commented Apr 9, 2019

Codecov Report

Merging #8563 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8563      +/-   ##
==========================================
+ Coverage   86.81%   86.81%   +<.01%     
==========================================
  Files         386      386              
  Lines       58162    58161       -1     
  Branches     1060     1060              
==========================================
+ Hits        50493    50494       +1     
+ Misses       7054     7052       -2     
  Partials      615      615
Impacted Files Coverage Δ
astropy/io/fits/hdu/image.py 95.87% <ø> (-0.01%) ⬇️
astropy/samp/hub.py 77.38% <0%> (-0.14%) ⬇️
astropy/io/fits/hdu/groups.py 89.83% <0%> (+0.98%) ⬆️

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 8824789...cb08b9a. Read the comment docs.

@bsipocz bsipocz modified the milestones: v3.2, v2.0.13 Apr 9, 2019
@pllim
Copy link
Member

pllim commented Apr 10, 2019

Tests passed but 😬

@pllim
Copy link
Member

pllim commented Apr 10, 2019

@saimn , you marked this as refactoring, not a bug. Generally speaking, we don't backport "refactoring". And if this is a bug, please update the labels and add a change log entry. Thanks!

@saimn
Copy link
Contributor Author

saimn commented Apr 10, 2019

@pllim - This is not a bug for me, there is no issue caused by this, so I'm fine with not backporting.

@MSeifert04
Copy link
Contributor

I agree with the not-backporting. Just in case (this is io.fits after all) this has some weird edge cases where it breaks some code.

I think this is fine.

@pllim pllim modified the milestones: v2.0.13, v3.2 Apr 10, 2019
@pllim
Copy link
Member

pllim commented Apr 10, 2019

I think this is fine.

@MSeifert04 , do you want to formalize it and hit "approve"? 😄

@MSeifert04
Copy link
Contributor

Maybe we could leave a bread-crump comment there that the data setter actually updates the header? This is completely optional, just to avoid potential confusion?!

@saimn
Copy link
Contributor Author

saimn commented Apr 10, 2019

I updated the comment just above.

just to avoid potential confusion?!

Maybe, but I love how the comment says that bitpix/bscale/bzero will be updated when setting the data, and just after it sets again those values in case they changed 😬

@pllim
Copy link
Member

pllim commented Apr 10, 2019

🤞 🤞 🤞

@pllim pllim merged commit 2447297 into astropy:master Apr 10, 2019
@saimn saimn deleted the fits-scale-uint branch April 10, 2019 18:32
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.

4 participants