Skip to content

Commit 3dc9a1e

Browse files
committed
#143 Update docstrings
1 parent 7c1bb2a commit 3dc9a1e

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

xarray_dataclasses/dataarray.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Submodule for DataArray creation."""
12
__all__ = ["AsDataArray", "asdataarray"]
23

34

xarray_dataclasses/datamodel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Submodule for data expression inside the package."""
12
__all__ = ["DataModel"]
23

34

@@ -32,7 +33,7 @@
3233
AnyEntry = Union["AttrEntry", "DataEntry"]
3334

3435

35-
# constants
36+
# runtime classes
3637
class MissingType:
3738
"""Singleton that indicates missing data."""
3839

@@ -51,7 +52,6 @@ def __repr__(self) -> str:
5152
MISSING = MissingType()
5253

5354

54-
# runtime classes
5555
@dataclass(frozen=True)
5656
class AttrEntry:
5757
"""Entry of an attribute (i.e. metadata)."""

xarray_dataclasses/dataoptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Submodule for customization of DataArray or Dataset creation."""
12
__all__ = ["DataOptions"]
23

34

xarray_dataclasses/dataset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Submodule for Dataset creation."""
12
__all__ = ["AsDataset", "asdataset"]
23

34

xarray_dataclasses/typing.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
)
4949

5050

51-
# type hints
51+
# type hints (private)
5252
PInit = ParamSpec("PInit")
5353
TAttr = TypeVar("TAttr")
5454
TDataClass = TypeVar("TDataClass", bound="DataClass[Any]")
@@ -86,7 +86,7 @@ def __init__(self, *args: PInit.args, **kwargs: PInit.kwargs) -> None:
8686
__dataclass_fields__: ClassVar[DataClassFields]
8787

8888

89-
# constants
89+
# type hints (public)
9090
class FieldType(Enum):
9191
"""Annotation of xarray-related field hints."""
9292

@@ -107,9 +107,8 @@ def annotates(self, hint: Any) -> bool:
107107
return self in get_args(hint)[1:]
108108

109109

110-
# public type hints
111110
Attr = Annotated[TAttr, FieldType.ATTR]
112-
"""Type hint to define attribute fields (``Attr[T]``).
111+
"""Type hint to define attribute fields (``Attr[TAttr]``).
113112
114113
Example:
115114
::
@@ -185,7 +184,7 @@ class Image(AsDataArray):
185184
Data = Annotated[Union[Collection[TDims, TDtype], TDtype], FieldType.DATA]
186185
"""Type hint to define data fields (``Coordof[TDims, TDtype]``).
187186
188-
Examples:
187+
Example:
189188
Exactly one data field is allowed in a DataArray class
190189
(the second and subsequent data fields are just ignored)::
191190

0 commit comments

Comments
 (0)