Skip to content

Commit

Permalink
updated docstrings of get_dataarray()
Browse files Browse the repository at this point in the history
  • Loading branch information
sadamov committed Dec 20, 2024
1 parent ef40a39 commit 71b52b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
8 changes: 3 additions & 5 deletions neural_lam/datastore/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,9 @@ def get_dataarray(
"""
Return the processed data (as a single `xr.DataArray`) for the given
category of data and test/train/val-split that covers all the data (in
space and time) of a given category (state/forcing/static). A
datastore must be able to return for the "state" category, but
"forcing" and "static" are optional (in which case the method should
return `None`). For the "static" category the `split` is allowed to be
`None` because the static data is the same for all splits.
space and time) of a given category (state/forcing/static). For the
"static" category the `split` is allowed to be `None` because the static
data is the same for all splits.
The returned dataarray is expected to at minimum have dimensions of
`(grid_index, {category}_feature)` so that any spatial dimensions have
Expand Down
5 changes: 2 additions & 3 deletions neural_lam/datastore/mdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,8 @@ def get_dataarray(self, category: str, split: str) -> xr.DataArray:
"""
Return the processed data (as a single `xr.DataArray`) for the given
category of data and test/train/val-split that covers all the data (in
space and time) of a given category (state/forcin g/static). "state" is
the only required category, for other categories, the method will
return `None` if the category is not found in the datastore.
space and time) of a given category (state/forcing/static). The method
will return `None` if the category is not found in the datastore.
The returned dataarray will at minimum have dimensions of `(grid_index,
{category}_feature)` so that any spatial dimensions have been stacked
Expand Down
8 changes: 3 additions & 5 deletions tests/dummy_datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,9 @@ def get_dataarray(
"""
Return the processed data (as a single `xr.DataArray`) for the given
category of data and test/train/val-split that covers all the data (in
space and time) of a given category (state/forcing/static). A
datastore must be able to return for the "state" category, but
"forcing" and "static" are optional (in which case the method should
return `None`). For the "static" category the `split` is allowed to be
`None` because the static data is the same for all splits.
space and time) of a given category (state/forcing/static). For the
"static" category the `split` is allowed to be `None` because the static
data is the same for all splits.
The returned dataarray is expected to at minimum have dimensions of
`(grid_index, {category}_feature)` so that any spatial dimensions have
Expand Down

0 comments on commit 71b52b2

Please sign in to comment.