{"action":"created","issue":{"url":"https://api.github.com/repos/xray/xray/issues/437","labels_url":"https://api.github.com/repos/xray/xray/issues/437/labels{/name}","comments_url":"https://api.github.com/repos/xray/xray/issues/437/comments","events_url":"https://api.github.com/repos/xray/xray/issues/437/events","html_url":"https://github.com/xray/xray/issues/437","id":89180768,"number":437,"title":"bit of code missing in documentation (http://xray.readthedocs.org/en/latest/io.html#combining-multiple-files)","user":{"login":"nicolasfauchereau","id":2539828,"avatar_url":"https://avatars.githubusercontent.com/u/2539828?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolasfauchereau","html_url":"https://github.com/nicolasfauchereau","followers_url":"https://api.github.com/users/nicolasfauchereau/followers","following_url":"https://api.github.com/users/nicolasfauchereau/following{/other_user}","gists_url":"https://api.github.com/users/nicolasfauchereau/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolasfauchereau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolasfauchereau/subscriptions","organizations_url":"https://api.github.com/users/nicolasfauchereau/orgs","repos_url":"https://api.github.com/users/nicolasfauchereau/repos","events_url":"https://api.github.com/users/nicolasfauchereau/events{/privacy}","received_events_url":"https://api.github.com/users/nicolasfauchereau/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-18T02:34:08Z","updated_at":"2015-06-18T05:09:31Z","closed_at":null,"body":"in [http://xray.readthedocs.org/en/latest/io.html#combining-multiple-files](http://xray.readthedocs.org/en/latest/io.html#combining-multiple-files) there is a bit of code missing in the function ```read_netcdfs```: instead of: \r\n\r\n```\r\ndef read_netcdfs(files, dim, transform_func=None):\r\n    def process_one_path(path):\r\n        # use a context manager, to ensure the file gets closed after use\r\n        with xray.open_dataset(path) as ds:\r\n            # transform_func should do some sort of selection or\r\n            # aggregation\r\n            if transform_func is not None:\r\n                ds = transform_func(ds)\r\n            # load all data from the transformed dataset, to ensure we can\r\n            # use it after closing each original file\r\n            ds.load()\r\n            return ds\r\n\r\n    paths = sorted(glob(files))\r\n    datasets = [process_one_path(p) for p in paths]\r\n    xray.concat(datasets, dim)\r\n``` \r\n\r\nit should be: \r\n\r\n```\r\ndef read_netcdfs(files, dim, transform_func=None):\r\n    def process_one_path(path):\r\n        # use a context manager, to ensure the file gets closed after use\r\n        with xray.open_dataset(path) as ds:\r\n            # transform_func should do some sort of selection or\r\n            # aggregation\r\n            if transform_func is not None:\r\n                ds = transform_func(ds)\r\n            # load all data from the transformed dataset, to ensure we can\r\n            # use it after closing each original file\r\n            ds.load()\r\n            return ds\r\n\r\n    paths = sorted(glob(files))\r\n    datasets = [process_one_path(p) for p in paths]\r\n    dset = xray.concat(datasets, dim)\r\n    return dset\r\n```\r\n\r\n\r\n\r\n "},"comment":{"url":"https://api.github.com/repos/xray/xray/issues/comments/113040075","html_url":"https://github.com/xray/xray/issues/437#issuecomment-113040075","issue_url":"https://api.github.com/repos/xray/xray/issues/437","id":113040075,"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-06-18T05:09:31Z","updated_at":"2015-06-18T05:09:31Z","body":"Indeed, looks like I'm missing the return statement. Want to make a pull request to fix it? Or I'll fix it if I get the chance to make a PR first. "}}