{"action":"created","issue":{"url":"https://api.github.com/repos/IDSIA/sacred/issues/114","repository_url":"https://api.github.com/repos/IDSIA/sacred","labels_url":"https://api.github.com/repos/IDSIA/sacred/issues/114/labels{/name}","comments_url":"https://api.github.com/repos/IDSIA/sacred/issues/114/comments","events_url":"https://api.github.com/repos/IDSIA/sacred/issues/114/events","html_url":"https://github.com/IDSIA/sacred/pull/114","id":168937759,"number":114,"title":"Added facility to apply a filter function to captured output.","user":{"login":"kevinmcguinness","id":1132072,"avatar_url":"https://avatars.githubusercontent.com/u/1132072?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinmcguinness","html_url":"https://github.com/kevinmcguinness","followers_url":"https://api.github.com/users/kevinmcguinness/followers","following_url":"https://api.github.com/users/kevinmcguinness/following{/other_user}","gists_url":"https://api.github.com/users/kevinmcguinness/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinmcguinness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinmcguinness/subscriptions","organizations_url":"https://api.github.com/users/kevinmcguinness/orgs","repos_url":"https://api.github.com/users/kevinmcguinness/repos","events_url":"https://api.github.com/users/kevinmcguinness/events{/privacy}","received_events_url":"https://api.github.com/users/kevinmcguinness/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-02T17:06:01Z","updated_at":"2016-08-02T18:24:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/IDSIA/sacred/pulls/114","html_url":"https://github.com/IDSIA/sacred/pull/114","diff_url":"https://github.com/IDSIA/sacred/pull/114.diff","patch_url":"https://github.com/IDSIA/sacred/pull/114.patch"},"body":"Adds a facility to apply a filter function to captured output. This is useful in situations where your experiment code uses a console based progress bar or similar in the text UI, but you would rather not have the observer store the control characters like backspaces and linefeeds in the database. This can be achieved by setting the `captured_out_filter` on the run or experiment as follows:\r\n\r\n```\r\nfrom sacred.utils import apply_backspaces_and_linefeeds\r\n\r\nex = Experiment('progress')\r\nex.captured_out_filter = apply_backspaces_and_linefeeds\r\n```\r\n\r\nIt would be possible to also implement this kind of thing by subclassing the observers and filtering the text there, or by changing the observers directly. However, in this case, the user would need to configure all observers. It would also make it harder to implement adding the observer via the command line interface like you can do now."},"comment":{"url":"https://api.github.com/repos/IDSIA/sacred/issues/comments/236995733","html_url":"https://github.com/IDSIA/sacred/pull/114#issuecomment-236995733","issue_url":"https://api.github.com/repos/IDSIA/sacred/issues/114","id":236995733,"user":{"login":"Qwlouse","id":1160920,"avatar_url":"https://avatars.githubusercontent.com/u/1160920?v=3","gravatar_id":"","url":"https://api.github.com/users/Qwlouse","html_url":"https://github.com/Qwlouse","followers_url":"https://api.github.com/users/Qwlouse/followers","following_url":"https://api.github.com/users/Qwlouse/following{/other_user}","gists_url":"https://api.github.com/users/Qwlouse/gists{/gist_id}","starred_url":"https://api.github.com/users/Qwlouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qwlouse/subscriptions","organizations_url":"https://api.github.com/users/Qwlouse/orgs","repos_url":"https://api.github.com/users/Qwlouse/repos","events_url":"https://api.github.com/users/Qwlouse/events{/privacy}","received_events_url":"https://api.github.com/users/Qwlouse/received_events","type":"User","site_admin":false},"created_at":"2016-08-02T18:24:02Z","updated_at":"2016-08-02T18:24:02Z","body":"Hey Kevin,\r\nwhat a nice PR. You even added an example. Thanks a lot!\r\nI was thinking about adding this feature myself, but I hesitated because I was concerned with the speed of the filter. But by making it optional and configurable this is not much of a problem. And maybe we can someday add a C-extension to do it fast. \r\n\r\nI'm merging it now, but it'll need some work for the new 0.7 release since I'm trying to switch to file-descriptor based capturing.\r\n"}}
{"actor":{"display_login":"Qwlouse"}}