Skip to content

Commit

Permalink
fix incorrect usage of ```
Browse files Browse the repository at this point in the history
  • Loading branch information
Datseris authored Jan 13, 2021
1 parent 35df2a4 commit 6458d75
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,6 @@ using PyCall
xr = pyimport("xarray")
np = pyimport("numpy")

"""
climarray_from_xarray(xa, fieldname, name = Symbol(fieldname))
Load underlying field with given `fieldname` from the given xarray instance `xa`,
optionally providing a name for it. This `xa` can be loaded with commands like
```julia
using PyCall, ClimateBase
xr = pyimport("xarray")
ERA5_files = "some_file_name.nc"
xa = xr.open_mfdataset(ERA5_files)
X = climarray_from_xarray(xa, "w", "optional name")
```
"""
function climarray_from_xarray(xa, fieldname, name = Symbol(fieldname))
w = getproperty(xa, Symbol(fieldname))
raw_data = Array(w.values)
Expand Down Expand Up @@ -144,6 +132,10 @@ function create_dims_xarray(dnames, dim_values, dim_attrs)
end
return (out...,)
end

# Load some data
xa = xr.open_mfdataset(ERA5_files_path)
X = climarray_from_xarray(xa, "w", "optional name")
```

## Temporal
Expand Down

0 comments on commit 6458d75

Please sign in to comment.