You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
io.ascii latex tables - take unit from inout table if given #2870
LaTeX and AASTex already have a mechanism to print units, but only if explicetly passed in. If no units are given, those writers could use the units already defined in the table column - we have a latex representation for that.
I just tried implementing this and found that changing the unit functionality will break certain tests in test_write.py. @hamogu - Do you have a sense for whether this will cause significant compatibility issues?
Here we explicitly want a change in behaviour. If units are specified in a table, then they shall also be in the output. Since we don't have that now, all tests that use a table with units will have to change.
Yes, this is a slight change in API, but I am totally fine with it for three reasons:
The current behaviour could be considered a bug (it implicitly drops information) that should be fixed.
LaTeX tables are almost never used to exchange data between applications. They are only written as really final output at the end of a toolchain when everything is ready for publication. Thus, we are not going to break someones analysis script, we are only going to change the appearance of the table on page 3 (or whatever) of the book he is writing.
We never promised that LaTeX tables round-trip and the docs definitely warn that the LaTeX reader is not feature complete in the sense that many LaTeX tables will not be read by this reader, although they are totally valid (e.g. tables where the data row are broken over different lines in the file - I suggest to fix some of those in io.ascii.Latex and AASTex: Make reading more flexible #1525, but there are many LaTeX commands that we will never read such as \multicolumn).
We should however think about reading tables with units and see if we can at least read the tables that we write (it's not a required feature to round-trip LaTeX tables, but would be nice).
Activity
mdmueller commentedon Oct 30, 2014
I just tried implementing this and found that changing the unit functionality will break certain tests in
test_write.py. @hamogu - Do you have a sense for whether this will cause significant compatibility issues?hamogu commentedon Oct 30, 2014
Here we explicitly want a change in behaviour. If units are specified in a table, then they shall also be in the output. Since we don't have that now, all tests that use a table with units will have to change.
Yes, this is a slight change in API, but I am totally fine with it for three reasons:
\multicolumn).We should however think about reading tables with units and see if we can at least read the tables that we write (it's not a required feature to round-trip LaTeX tables, but would be nice).