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
io.ascii.read no longer automatically recognizes tables in fixed_width_twoline format #5398
Comments
I remember reading some comment from @taldcroft that setting |
I can fix the problem in my programs by setting the format when I read data in. The issue from my perspective is that “guessing” no longer works.
Note: I included the astropy version at the beginning of my original message. If there is another version number that is needed, please let me know
|
It is |
No, I have not tried 1.3.dev |
The problem here is that your table file only has one column. One of the rules for guessing a format is that it must have at least two columns. For some formats you can get false positives if you allow an output with just one column. I.e. Think about comma separated where you try to read with space delimited. |
Fair enough, I guess. But then perhaps there should at least be a warning. In practice, ascii.read does read the one-column table and the routine proceeds merrily along.
|
In the past, that is pre u'1.2.dev15800, one could write an asciii table in fixed_width_two_line and then read it back (allowing the routine to guess the format), but now when you do this (possibly only when the columns are strings) it is interpreting the second line in the table (the line containing ---) as values in the columns.
A short program and the data I was using are below:
I had thought that fixed_width_two_line was one of the formats that ascii.read was guaranteed to recognize (which was the reason I had selected it as my default output style), and so am surprised that this feature has apparently been "lost". As far as I remember that is how the old documentation read.
The new documentaion now appears to prefer a more basic format, but it seems like this would be an easy problem to fix, since a fixed-header is the only one that would have a line with all --
The text was updated successfully, but these errors were encountered: