Skip to content

Commit 1070f93

Browse files
author
Joe Hamman
authored
Merge pull request #5 from carbonplan/docs
adding DatasetSchema example to README
2 parents 2689bc4 + 4782108 commit 1070f93

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ schema = DataArraySchema(dtype=np.integer, name='foo', shape=(4, ), dims=['x'])
3636
schema.validate(da)
3737
```
3838

39+
You can also use it to validate a Dataset like so:
40+
41+
```
42+
schema_ds = DatasetSchema({'foo': schema})
43+
44+
schema_ds.validate(da.to_dataset())
45+
```
46+
3947
# roadmap
4048

4149
This is a very early prototype of a library. Some key things are missing:

0 commit comments

Comments
 (0)