Repository navigation
Split io.ascii CDS/MRT into distinct CDS and MRT classes - #12301
Conversation
|
Hmm, am I missing something in my test setup? Getting in the local run now with pytest.raises(UserWarning):
t.write(out, format='ascii.mrt')
lines = out.getvalue().splitlines()
i_bbb = lines.index('=' * 80)
lines = lines[i_bbb:] # Select Byte-By-Byte section and later lines.
# Check the written table.
> assert lines == exp_output.splitlines()
E AssertionError: assert ['===========...me ', ...] == ['===========...of name', ...]
E At index 5 diff: ' 1- 7 A7 --- name Description of name ' != ' 1- 7 A7 --- name Description of name'
E Left contains 6 more items, first extra item: '104-107 F4.1 arcmin DEm Declination (arcmin) '
E Full diff:
E [
E '================================================================================',
E 'Byte-by-byte Description of file: table.dat',
E '--------------------------------------------------------------------------------',...
E
E ...Full output truncated (51 lines hidden), use '-vv' to show
lib/python3.9/site-packages/astropy/io/ascii/tests/test_cds.py:476: AssertionErrorThe full output from the writer looks like so has indeed the duplicate columns. |
|
I have a feeling that we may want @dhomeier 's #12302 first and then pull that over into this one? Coincidentally, @aaryapatil and I had a discussion with @Suyog7130 not too long ago and we talked about how to continue with his remaining PRs. We decided to wait until after the 5.0 release to not run into conflicts with other urgent PRs. I'm just saying this to make clear that we did not abandon the the project; but of course we welcome @taldcroft doing those changes here! |
No, you are completely right, I had not been following the development in #11897 very closely and just saw this falling to earth in the midst of all the discussion on the azure failures. I think @pllim has given a good explanation why the test does not fail on CI. |
|
See #12302 (comment) for my argument that this PR should go in first. I think doing it the opposite way round will result in a nightmare rebase. My first step to create |
I think this is an urgent PR for 5.0 because otherwise after that doing the splitting represents an API change and will break existing code that was using |
|
Yes, I agree both that merging them in numerical order ;-) should be easier, and the API as defined here would better be finalised for 5.0. |
|
The only irreconcilable bit is likely to be the changes I made in the test expected output where I turned them all into lists of strings. They were passing before because of trailing whitespace in the strings, and my editor just chopped all those immediately. I figured other people might have that (whitespace autotrim) enabled and have the same problem. Yck, not sure of the easiest way forward but open to any suggestions. |
|
Yes, I ran into a similar thing when style-check would accept them in the tests (with the |
That will work and hopefully be not too painful. My process was to temporarily put In any case I'm going to do the tests and changelog right now. |
|
|
|
Actually looks like #12300 is merged, so rebasing should fix that unrelated failure. |
d7138b5 to
971b3fc
Compare
|
Hello @taldcroft 👋! It looks like you've made some changes in your pull request, so I've checked the code again for style. There are no PEP8 style issues with this pull request - thanks! 🎉 Comment last updated at 2021-10-29 16:58:27 UTC |
|
OK, rebased and added test coverage for MRT reading and a news fragment. This fragment is an exact copy of that for #11897 which should make them into one in the final changelog. |
971b3fc to
fffac0b
Compare
|
To help slightly with the review, here is the diff of the current |
|
🤞 on tests, but I think this is ready for review @dhomeier @aaryapatil @hamogu . |
|
Merging my |
|
This was passing all tests except Azure in fffac0b. |
dhomeier
left a comment
There was a problem hiding this comment.
Took a while to find though the get_testfiles changes, but apart from the minor grammar nitpicks good to go!
|
Sorry, somewhat too many releases and feature freezes for one day! |
Co-authored-by: Derek Homeier <[email protected]>
Description
As mentioned in discussions / review for #11897, despite some similarities the MRT (AAS machine-readable table) format is distinct from the CDS format. Most notably, according to section 2.2 of http://vizier.u-strasbg.fr/doc/catstd-2.htx, the
ReadMefile is "always present". This means that writing a data table into a single file is, by definition, not CDS.This PR takes the excellent work in #11897 and just sloshes code around without any functional change so that now we have the MRT format with a reader + writer and a CDS reader (no writer). The CDS reader
cds.pyis essentially reverted to the state prior to #11897, and the MRT reader/write inherits from CDS where it makes sense.This PR sets the stage for improving the MRT reader and writer, e.g. to properly support parsing and writing the authors, title and table name information. It would also allow the CDS reader to parse the metadata specific to that format.
To do:
This partially addresses #12130
cc: @hamogu @aaryapatil @Suyog7130
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
Extra CIlabel.no-changelog-entry-neededlabel. If this is a manual backport, use theskip-changelog-checkslabel unless special changelog handling is necessary.astropy-botcheck might be missing; do not let the green checkmark fool you.backport-X.Y.xlabel(s) before merge.