{"action":"created","issue":{"url":"https://api.github.com/repos/astropy/astropy/issues/2869","labels_url":"https://api.github.com/repos/astropy/astropy/issues/2869/labels{/name}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/2869/comments","events_url":"https://api.github.com/repos/astropy/astropy/issues/2869/events","html_url":"https://github.com/astropy/astropy/pull/2869","id":40609998,"number":2869,"title":"Added ability to show unit in fixed width tables","user":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/astropy/astropy/labels/io.ascii","name":"io.ascii","color":"c7def8"}],"state":"open","locked":false,"assignee":{"login":"taldcroft","id":348089,"avatar_url":"https://avatars.githubusercontent.com/u/348089?v=3","gravatar_id":"","url":"https://api.github.com/users/taldcroft","html_url":"https://github.com/taldcroft","followers_url":"https://api.github.com/users/taldcroft/followers","following_url":"https://api.github.com/users/taldcroft/following{/other_user}","gists_url":"https://api.github.com/users/taldcroft/gists{/gist_id}","starred_url":"https://api.github.com/users/taldcroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taldcroft/subscriptions","organizations_url":"https://api.github.com/users/taldcroft/orgs","repos_url":"https://api.github.com/users/taldcroft/repos","events_url":"https://api.github.com/users/taldcroft/events{/privacy}","received_events_url":"https://api.github.com/users/taldcroft/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/astropy/astropy/milestones/20","html_url":"https://github.com/astropy/astropy/milestones/v1.1.0","labels_url":"https://api.github.com/repos/astropy/astropy/milestones/20/labels","id":907426,"number":20,"title":"v1.1.0","description":"","creator":{"login":"eteq","id":346587,"avatar_url":"https://avatars.githubusercontent.com/u/346587?v=3","gravatar_id":"","url":"https://api.github.com/users/eteq","html_url":"https://github.com/eteq","followers_url":"https://api.github.com/users/eteq/followers","following_url":"https://api.github.com/users/eteq/following{/other_user}","gists_url":"https://api.github.com/users/eteq/gists{/gist_id}","starred_url":"https://api.github.com/users/eteq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eteq/subscriptions","organizations_url":"https://api.github.com/users/eteq/orgs","repos_url":"https://api.github.com/users/eteq/repos","events_url":"https://api.github.com/users/eteq/events{/privacy}","received_events_url":"https://api.github.com/users/eteq/received_events","type":"User","site_admin":false},"open_issues":43,"closed_issues":122,"state":"open","created_at":"2014-12-17T20:05:23Z","updated_at":"2015-09-17T20:40:00Z","due_on":"2015-07-23T04:00:00Z","closed_at":null},"comments":45,"created_at":"2014-08-19T16:29:16Z","updated_at":"2015-09-19T15:34:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/2869","html_url":"https://github.com/astropy/astropy/pull/2869","diff_url":"https://github.com/astropy/astropy/pull/2869.diff","patch_url":"https://github.com/astropy/astropy/pull/2869.patch"},"body":"Example usage:\r\n\r\n```python\r\nt = Table()\r\nt['a'] = [1,2,33133]\r\nt['b'] = [1293494., 11., 1./3.]\r\nt['c'] = ['a','c','wqdqwd']\r\nt['a'].unit = 'mJy'\r\nt['c'].unit = 'ergs/cm^2/s/Hz/ster'\r\nt.write('test.txt', format='ascii.fixed_width', header_unit_line=True)\r\n```\r\n\r\ngives:\r\n\r\n```\r\n|     a |              b |                   c |\r\n|   mJy |                | ergs/cm^2/s/Hz/ster |\r\n|     1 |      1293494.0 |                   a |\r\n|     2 |           11.0 |                   c |\r\n| 33133 | 0.333333333333 |              wqdqwd |\r\n```\r\n\r\nand\r\n\r\n```python\r\nt.write('test.txt', format='ascii.fixed_width', header_unit_line=True, delimiter=' ')\r\n```\r\n\r\ngives\r\n\r\n```\r\n      a                b                     c  \r\n    mJy                    ergs/cm^2/s/Hz/ster  \r\n      1        1293494.0                     a  \r\n      2             11.0                     c  \r\n  33133   0.333333333333                wqdqwd  \r\n```\r\n\r\ncc @eteq @taldcroft @hamogu\r\n\r\nI can add a test if people are in favor."},"comment":{"url":"https://api.github.com/repos/astropy/astropy/issues/comments/141679833","html_url":"https://github.com/astropy/astropy/pull/2869#issuecomment-141679833","issue_url":"https://api.github.com/repos/astropy/astropy/issues/2869","id":141679833,"user":{"login":"taldcroft","id":348089,"avatar_url":"https://avatars.githubusercontent.com/u/348089?v=3","gravatar_id":"","url":"https://api.github.com/users/taldcroft","html_url":"https://github.com/taldcroft","followers_url":"https://api.github.com/users/taldcroft/followers","following_url":"https://api.github.com/users/taldcroft/following{/other_user}","gists_url":"https://api.github.com/users/taldcroft/gists{/gist_id}","starred_url":"https://api.github.com/users/taldcroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taldcroft/subscriptions","organizations_url":"https://api.github.com/users/taldcroft/orgs","repos_url":"https://api.github.com/users/taldcroft/repos","events_url":"https://api.github.com/users/taldcroft/events{/privacy}","received_events_url":"https://api.github.com/users/taldcroft/received_events","type":"User","site_admin":false},"created_at":"2015-09-19T15:34:03Z","updated_at":"2015-09-19T15:34:03Z","body":"@astrofrog - Just reviewing assigned PRs, finally...  This one got a huge amount of discussion without any firm resolution.  @mhvk had one nice summary comment mentioning \"convergence\", but since Python2 doesn't have `redirect_stdout` I'm not sure this is the best solution.  So if you have time and want to finish off this PR with tests then go for it!  \r\n\r\nI wonder if the round-tripping could be solved using a corresponding `header_unit_line` keyword in the reader.  It also occurred to me the `fixed_width_two_line` format would be able to \"find\" a unit line without requiring a keyword because it can see if there is a line with units prior to the `--- ---- ---` delimiter line.  That would allow the output of `pprint()` to be parsed and return the units."}}