Skip to content

Remove duplicate call to update_header - #8563

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

pllim merged 2 commits into
astropy:masterfrom
saimn:fits-scale-uint

Conversation

@saimn

@saimn saimn commented Apr 9, 2019

Copy link
Copy Markdown
Contributor

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

bsipocz commented Apr 9, 2019

Copy link
Copy Markdown
Member

Is this backportable?

@saimn

saimn commented Apr 9, 2019

Copy link
Copy Markdown
Contributor Author

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

codecov Bot commented Apr 9, 2019 •

Copy link
Copy Markdown

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

pllim commented Apr 10, 2019

Copy link
Copy Markdown
Member

Tests passed but 😬

@pllim

pllim commented Apr 10, 2019

Copy link
Copy Markdown
Member

@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

saimn commented Apr 10, 2019

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
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

pllim commented Apr 10, 2019

Copy link
Copy Markdown
Member

I think this is fine.

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

@MSeifert04

Copy link
Copy Markdown
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

saimn commented Apr 10, 2019

Copy link
Copy Markdown
Contributor Author

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

pllim commented Apr 10, 2019

Copy link
Copy Markdown
Member

🤞 🤞 🤞

@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