{"action":"created","issue":{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/3507","labels_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/3507/labels{/name}","comments_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/3507/comments","events_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/3507/events","html_url":"https://github.com/openmicroscopy/openmicroscopy/pull/3507","id":58224952,"number":3507,"title":"Improvements to disk usage plugin","user":{"login":"ximenesuk","id":1065145,"avatar_url":"https://avatars.githubusercontent.com/u/1065145?v=3","gravatar_id":"","url":"https://api.github.com/users/ximenesuk","html_url":"https://github.com/ximenesuk","followers_url":"https://api.github.com/users/ximenesuk/followers","following_url":"https://api.github.com/users/ximenesuk/following{/other_user}","gists_url":"https://api.github.com/users/ximenesuk/gists{/gist_id}","starred_url":"https://api.github.com/users/ximenesuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ximenesuk/subscriptions","organizations_url":"https://api.github.com/users/ximenesuk/orgs","repos_url":"https://api.github.com/users/ximenesuk/repos","events_url":"https://api.github.com/users/ximenesuk/events{/privacy}","received_events_url":"https://api.github.com/users/ximenesuk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/labels/develop","name":"develop","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-02-19T15:44:29Z","updated_at":"2015-02-20T15:38:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/3507","html_url":"https://github.com/openmicroscopy/openmicroscopy/pull/3507","diff_url":"https://github.com/openmicroscopy/openmicroscopy/pull/3507.diff","patch_url":"https://github.com/openmicroscopy/openmicroscopy/pull/3507.patch"},"body":"This PR is intended to improve the output options for the disk usage plug-in now that size and file counts are available at a per-user, per-group, per-component level. Firstly it allows totals to be summed by any of the three parts above:\r\n```\r\n--sum_by {user,group,component} [{user,group,component} ...]`\r\n```\r\nwhich will sum the totals by one, two or all three options. Summing by all three options is the same as not using this flag at all, ie the default. This only has an effect when the `--report`` option is used.\r\n\r\nThe second addition is:\r\n```\r\n--pretty\r\n```\r\nThis pretty-prints the sizes by making the human-readable. This works for both the single value and for the table when `--report` is used. It is, however, overridden by any `--units` setting for the single value. The other minor point is `--units` produces KiB, MiB, etc., while `--pretty` produces KB, MB, etc.\r\n\r\nThis PR is very much for comments.\r\n + I'm not wedded to the option names, I don't really like `--sum_by` even though it describes what it does.\r\n + Same goes with `--pretty`, I originally had `--human-readable`. Maybe adding single letter options would help?\r\n + Should `--units` apply to the table to, ie either forced units or human-readable across the board? The downside with this is that the smaller table entries may show as 0 for large units\r\n + KiB vs KB!? The method producing the pretty printing is used exclusively by the `fs` command as far as I can see so we could switch. Or add an `iec=False` argument, though that seems like overkill for what this does\r\n\r\nTODO: Since these numbers pass through dictionaries the original ordering from the response object is lost. An order was never guaranteed but it tended to be ordered to the eye. So adding an ordering by columns option, probably pushed to TableBuilder, makes sense.\r\n\r\nTesting instructions\r\n--------------------------\r\nSee https://github.com/openmicroscopy/openmicroscopy/pull/3009 for basic instructions.\r\n```\r\nbin/omero fs usage -h\r\n```\r\nshould provide more help. The two added options are `--pretty` and `--sum_by`. \r\n\r\nFor `--pretty` try it with and without the `--units` option. The latter option should have precedence. Also try it with `--report`, the bytes column in the table should have more human readable numbers.\r\n\r\nFor  `--sum_by`, which only works in combination with `--report`, try it with all combinations of `user`, `group` and `component`. Using all three options should be the same as not using `--sum_by` at all. The final two columns should be right-justified for any use of `--report`.\r\n\r\nFinally, check some other commands that produce tables, `bin/omero user list`, etc. The tables should be correctly formatted and all columns should be left justified.\r\n"},"comment":{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/comments/75257919","html_url":"https://github.com/openmicroscopy/openmicroscopy/pull/3507#issuecomment-75257919","issue_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/3507","id":75257919,"user":{"login":"sbesson","id":1355463,"avatar_url":"https://avatars.githubusercontent.com/u/1355463?v=3","gravatar_id":"","url":"https://api.github.com/users/sbesson","html_url":"https://github.com/sbesson","followers_url":"https://api.github.com/users/sbesson/followers","following_url":"https://api.github.com/users/sbesson/following{/other_user}","gists_url":"https://api.github.com/users/sbesson/gists{/gist_id}","starred_url":"https://api.github.com/users/sbesson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbesson/subscriptions","organizations_url":"https://api.github.com/users/sbesson/orgs","repos_url":"https://api.github.com/users/sbesson/repos","events_url":"https://api.github.com/users/sbesson/events{/privacy}","received_events_url":"https://api.github.com/users/sbesson/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T15:38:37Z","updated_at":"2015-02-20T15:38:37Z","body":"One extreme possibility would certainly be to auto-generate some Sphinx documentation from this command (with modification) and use the `autogen_docs` logic to include the CLI auto-generated documentation in the documentation. Individual sections from each documentation (users/sysadmin/developers) could then refer to appropriate commands."}}