Skip to content

Fix behavior of scaled columns in binary table - #6956

Merged
drdavella merged 6 commits into
astropy:masterfrom
saimn:fix-table-scaling
Jan 24, 2018
Merged

drdavella merged 6 commits into
astropy:masterfrom
saimn:fix-table-scaling

Conversation

@saimn

@saimn saimn commented Dec 8, 2017

Copy link
Copy Markdown
Contributor

Fix #6887.

Once a column with a tscale or tzero keyword is scaled, it was not marked as such. So if the column was modified and then saved, the old (unscaled) values when saved instead.

It seems that all what was missing was to put the _physical_values flag to True.

While looking at old issues I found #4709 which is very similar, so I included these 2 commits. Sadly it is not enough to fix #3921 (I still do not understand everything there 🙄 )

Note: There is no 2.0.4 section in the changelog yet, so I used 2.0.3 for now.

@saimn saimn added the io.fits label Dec 8, 2017
@saimn saimn added this to the v2.0.4 milestone Dec 8, 2017
@astropy-bot

astropy-bot Bot commented Dec 8, 2017 •

Copy link
Copy Markdown

Hi there @saimn 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃.

Everything looks good from my point of view! 👍

If there are any issues with this message, please report them here.

@MSeifert04

Copy link
Copy Markdown
Contributor

needs a rebase because of the conflict.

Also: Why is there a significant decrease in coverage? 😕

@bsipocz

bsipocz commented Dec 11, 2017

Copy link
Copy Markdown
Member

for changelog issue, no need to rebase now only when it's ready to be merged (more changes are expected with 2.0.3)

@saimn

saimn commented Dec 11, 2017

Copy link
Copy Markdown
Contributor Author

Also: Why is there a significant decrease in coverage? 😕

Hmm I think the code removal explains this (as it was probably well tested) ? roughly 40 lines / 100000 gives 0.04%

@bsipocz

bsipocz commented Dec 11, 2017

Copy link
Copy Markdown
Member

Another possibility is that the top of master changed with significant changes between opening this and the actual run of the coverage test.

@saimn

saimn commented Dec 11, 2017

Copy link
Copy Markdown
Contributor Author

Yes maybe, we can see when I rebase the branch.
Should I wait for 2.0.4 ? The fix in itself is quite straightforward I think, but the code removal can be more frightening. I'm also afraid of it 😄 but after looking at the code I think it's ok and it would be sad to miss an opportunity to simplify a bit the code.

@drdavella

Copy link
Copy Markdown
Contributor

@saimn, this looks good to me (in as much as I can follow it). Just curious, but even though this doesn't fix #3921, is there currently a corresponding test that xfails? If not, do you understand the problem enough to add an xfail test to this PR?

@bsipocz

bsipocz commented Dec 14, 2017 •

Copy link
Copy Markdown
Member

2.0.3 is out, so this can be now rebased.

@saimn
saimn force-pushed the fix-table-scaling branch from 452fca3 to 82e7127 Compare December 19, 2017 19:40
@saimn

saimn commented Dec 19, 2017

Copy link
Copy Markdown
Contributor Author

@drdavella - This commit was meant to reproduce the issue, but it seems that it is not exactly the same as this test now pass but I can still reproduce the error described in #3921. But anyway I prefer to leave this for another round, I think it's better to have the test with the corresponding fix (or the opposite ;)).

Otherwise I rebased to be sure the changelog is there for 2.0.4.

saimn and others added 6 commits December 21, 2017 23:24
Once a column with a tscale or tzero keyword is scaled, it was not
marked as such. So if the column was modified and then saved, the old
(unscaled) values when saved instead.

It seems that all what was missing was to put the `_physical_values`
flag to True.
…hat always nice? This handling of unsigned ints already happens in FITS_rec.from_columns, by way of Column._convert_to_valid_data_type.
@saimn
saimn force-pushed the fix-table-scaling branch from 82e7127 to 7d44b58 Compare December 21, 2017 22:25
@saimn

saimn commented Jan 9, 2018

Copy link
Copy Markdown
Contributor Author

ping @MSeifert04 @drdavella - is this fine for you ?

What's the policy for v3.0 inclusion now that it is branched ? It can go to v3.0.1 if needed, but it is "just" a bugfix.

@bsipocz

bsipocz commented Jan 13, 2018

Copy link
Copy Markdown
Member

@saimn - bugfixes can still go into 3.0.0, especially everything that goes into 2.0.4 should actually end up being in 3.0.0, too (unless 2.0.x specific, and we don't have that many of those).

@saimn

saimn commented Jan 15, 2018

Copy link
Copy Markdown
Contributor Author

@bsipocz - Ok great, so I just need someone to approve 😉 (ping @drdavella as you already had a look)

@saimn

saimn commented Jan 24, 2018

Copy link
Copy Markdown
Contributor Author

@drdavella @MSeifert04 - ping !

@drdavella
drdavella merged commit 6dbd31a into astropy:master Jan 24, 2018
@drdavella

Copy link
Copy Markdown
Contributor

@saimn I don't think you meant to close #3921 with this PR right? It looks like it will need to be reopened.

bsipocz pushed a commit that referenced this pull request Jan 24, 2018
Fix behavior of scaled columns in binary table
bsipocz pushed a commit that referenced this pull request Jan 24, 2018
Fix behavior of scaled columns in binary table
@saimn
saimn deleted the fix-table-scaling branch January 24, 2018 20:19
@saimn

saimn commented Jan 24, 2018

Copy link
Copy Markdown
Contributor Author

Thanks, good catch (I should be more careful when using "fix" in the issue description!).

@MSeifert04

Copy link
Copy Markdown
Contributor

Thanks @saimn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

5 participants