{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/xarray/issues/2482","repository_url":"https://api.github.com/repos/pydata/xarray","labels_url":"https://api.github.com/repos/pydata/xarray/issues/2482/labels{/name}","comments_url":"https://api.github.com/repos/pydata/xarray/issues/2482/comments","events_url":"https://api.github.com/repos/pydata/xarray/issues/2482/events","html_url":"https://github.com/pydata/xarray/pull/2482","id":369673042,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNTU3NzU5","number":2482,"title":"Global option to always keep/discard attrs on operations","user":{"login":"TomNicholas","id":35968931,"node_id":"MDQ6VXNlcjM1OTY4OTMx","avatar_url":"https://avatars2.githubusercontent.com/u/35968931?v=4","gravatar_id":"","url":"https://api.github.com/users/TomNicholas","html_url":"https://github.com/TomNicholas","followers_url":"https://api.github.com/users/TomNicholas/followers","following_url":"https://api.github.com/users/TomNicholas/following{/other_user}","gists_url":"https://api.github.com/users/TomNicholas/gists{/gist_id}","starred_url":"https://api.github.com/users/TomNicholas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomNicholas/subscriptions","organizations_url":"https://api.github.com/users/TomNicholas/orgs","repos_url":"https://api.github.com/users/TomNicholas/repos","events_url":"https://api.github.com/users/TomNicholas/events{/privacy}","received_events_url":"https://api.github.com/users/TomNicholas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-10-12T19:01:12Z","updated_at":"2018-10-27T14:05:53Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/pydata/xarray/pulls/2482","html_url":"https://github.com/pydata/xarray/pull/2482","diff_url":"https://github.com/pydata/xarray/pull/2482.diff","patch_url":"https://github.com/pydata/xarray/pull/2482.patch"},"body":" - [x] Resolves wishes of some users and relevant for discussion in #138, #442, #688, #828, #988, #1009, #1271, #2288, #2473\r\n - [x] Tests added, both of setting the option and of attributes propagating in the expected way \r\n - [x] Tests passed\r\n - [x] Documented\r\n\r\nAdds a global option to either always keep or always discard attrs in method and function calls. \r\n\r\nThe behaviour is backwards-compatible, as the logic is:\r\n- if `keep_attrs` supplied as keyword argument then use that\r\n- else if global option (`xarray.set_options(keep_attrs=True)`) is set then use that\r\n- else use default value of `keep_attrs` argument for that particular function/method (kept the same as they were for backwards-compatibility).\r\n\r\nMain use cases include users who want to store the units of their data in the attrs, users who want to always keep information about the source or history of their data, and users who want to store objects in their attributes which are needed to supplement the xarray objects (e.g. an `xgcm.grid`). It should eventually be superceded by hooks for custom attribute handling (#988), but will be useful until then. \r\n\r\nI have left the top-level functions like `concat` and `merge` alone. Currently concat keeps the attributes of the first object passed to it, and merge returns a dataset with no attributes. It's not clear how this should be treated though, so I left it to users to extend those functions if they need to.  "},"comment":{"url":"https://api.github.com/repos/pydata/xarray/issues/comments/433623298","html_url":"https://github.com/pydata/xarray/pull/2482#issuecomment-433623298","issue_url":"https://api.github.com/repos/pydata/xarray/issues/2482","id":433623298,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzYyMzI5OA==","user":{"login":"spencerkclark","id":6628425,"node_id":"MDQ6VXNlcjY2Mjg0MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/6628425?v=4","gravatar_id":"","url":"https://api.github.com/users/spencerkclark","html_url":"https://github.com/spencerkclark","followers_url":"https://api.github.com/users/spencerkclark/followers","following_url":"https://api.github.com/users/spencerkclark/following{/other_user}","gists_url":"https://api.github.com/users/spencerkclark/gists{/gist_id}","starred_url":"https://api.github.com/users/spencerkclark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spencerkclark/subscriptions","organizations_url":"https://api.github.com/users/spencerkclark/orgs","repos_url":"https://api.github.com/users/spencerkclark/repos","events_url":"https://api.github.com/users/spencerkclark/events{/privacy}","received_events_url":"https://api.github.com/users/spencerkclark/received_events","type":"User","site_admin":false},"created_at":"2018-10-27T14:05:53Z","updated_at":"2018-10-27T14:05:53Z","author_association":"CONTRIBUTOR","body":"@TomNicholas it looks like the merge conflict in `whats-new.rst` is preventing the CI from running.  I think if you sync with the latest master branch and resolve the conflict things should work properly."}}
{"actor":{"display_login":"spencerkclark"}}