Skip to content

Commit

Permalink
missing return value in sample function calls (I think) (#1088)
Browse files Browse the repository at this point in the history
* missing return value in sample function calls (I think)

* Fixed indentation
  • Loading branch information
vnoel authored and shoyer committed Nov 16, 2016
1 parent 565c9a3 commit 6c90583
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ library::
combined = xr.concat(dataset, dim)
return combined

read_netcdfs('/all/my/files/*.nc', dim='time')
combined = read_netcdfs('/all/my/files/*.nc', dim='time')

This function will work in many cases, but it's not very robust. First, it
never closes files, which means it will fail one you need to load more than
Expand Down Expand Up @@ -454,8 +454,8 @@ deficiencies::

# here we suppose we only care about the combined mean of each file;
# you might also use indexing operations like .sel to subset datasets
read_netcdfs('/all/my/files/*.nc', dim='time',
transform_func=lambda ds: ds.mean())
combined = read_netcdfs('/all/my/files/*.nc', dim='time',
transform_func=lambda ds: ds.mean())

This pattern works well and is very robust. We've used similar code to process
tens of thousands of files constituting 100s of GB of data.

0 comments on commit 6c90583

Please sign in to comment.