{"action":"created","issue":{"url":"https://api.github.com/repos/xray/xray/issues/540","labels_url":"https://api.github.com/repos/xray/xray/issues/540/labels{/name}","comments_url":"https://api.github.com/repos/xray/xray/issues/540/comments","events_url":"https://api.github.com/repos/xray/xray/issues/540/events","html_url":"https://github.com/xray/xray/issues/540","id":101857508,"number":540,"title":"allow custom 'units' when saving datetimes to netCDF","user":{"login":"andreas-h","id":358378,"avatar_url":"https://avatars.githubusercontent.com/u/358378?v=3","gravatar_id":"","url":"https://api.github.com/users/andreas-h","html_url":"https://github.com/andreas-h","followers_url":"https://api.github.com/users/andreas-h/followers","following_url":"https://api.github.com/users/andreas-h/following{/other_user}","gists_url":"https://api.github.com/users/andreas-h/gists{/gist_id}","starred_url":"https://api.github.com/users/andreas-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreas-h/subscriptions","organizations_url":"https://api.github.com/users/andreas-h/orgs","repos_url":"https://api.github.com/users/andreas-h/repos","events_url":"https://api.github.com/users/andreas-h/events{/privacy}","received_events_url":"https://api.github.com/users/andreas-h/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-19T10:24:22Z","updated_at":"2015-08-19T18:09:42Z","closed_at":null,"body":"when manually setting the `units` attribute of a DataArray containing datetime types, the error\r\n\r\n    ValueError: Failed hard to prevent overwriting key 'units'\r\n\r\nis raised.\r\n\r\nIt would be good to allow custom units, because currently the units seem to be `days since FIRST_TIMESTEP`, which leads to different units for different variables within the same Dataset."},"comment":{"url":"https://api.github.com/repos/xray/xray/issues/comments/132725722","html_url":"https://github.com/xray/xray/issues/540#issuecomment-132725722","issue_url":"https://api.github.com/repos/xray/xray/issues/540","id":132725722,"user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"created_at":"2015-08-19T18:09:42Z","updated_at":"2015-08-19T18:09:42Z","body":"We should raise a better error message. You can indeed actually customize this by setting an approach `encoding` on the DataArray, e.g.,\r\n`ds.time.encoding['units'] = 'hours since 1900-01-01T00'"}}