Skip to content

Commit 2ce4f9b

Browse files
committed
docs: add docstrings to a few attributes
1 parent aa0da64 commit 2ce4f9b

File tree

3 files changed

+31
-14
lines changed

3 files changed

+31
-14
lines changed

stagpy/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Define configuration variables for StagPy.
22
3-
See :mod:`stagpy.args` for additional definitions related to the command line
3+
See [stagpy.args][] for additional definitions related to the command line
44
interface.
55
"""
66

@@ -21,6 +21,7 @@
2121
)
2222

2323
CONFIG_LOCAL = Path(".stagpy.toml")
24+
"""Path of local configuration file."""
2425

2526

2627
@dataclass

stagpy/datatypes.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,60 +11,67 @@
1111

1212
@dataclass(frozen=True)
1313
class Varf:
14-
"""Metadata of scalar field.
15-
16-
`dim` is the dimension used to scale to dimensional values.
17-
"""
14+
"""Metadata of scalar field."""
1815

1916
description: str
17+
"""description of field variable."""
2018
dim: str
19+
"""dimension used to scale to dimensional values."""
2120

2221

2322
@dataclass(frozen=True)
2423
class Field:
2524
"""Scalar field and associated metadata."""
2625

2726
values: NDArray
27+
"""values of field."""
2828
meta: Varf
29+
"""metadata."""
2930

3031

3132
@dataclass(frozen=True)
3233
class Varr:
33-
"""Metadata of radial profiles.
34-
35-
`dim` is the dimension used to scale to dimensional values.
36-
"""
34+
"""Metadata of radial profiles."""
3735

3836
description: str
37+
"""description of profile variable."""
3938
kind: str
39+
"""short description"""
4040
dim: str
41+
"""dimension used to scale to dimensional values."""
4142

4243

4344
@dataclass(frozen=True)
4445
class Rprof:
4546
"""Radial profile with associated radius and metadata."""
4647

4748
values: NDArray
49+
"""values of profile."""
4850
rad: NDArray
51+
"""radial position of profile."""
4952
meta: Varr
53+
"""metadata."""
5054

5155

5256
@dataclass(frozen=True)
5357
class Vart:
54-
"""Metadata of time series.
55-
56-
`dim` is the dimension used to scale to dimensional values.
57-
"""
58+
"""Metadata of time series."""
5859

5960
description: str
61+
"""description of time series."""
6062
kind: str
63+
"""short description"""
6164
dim: str
65+
"""dimension used to scale to dimensional values."""
6266

6367

6468
@dataclass(frozen=True)
6569
class Tseries:
6670
"""A time series with associated time and metadata."""
6771

6872
values: NDArray
73+
"""values of time series."""
6974
time: NDArray
75+
"""time position of time series."""
7076
meta: Vart
77+
"""metadata."""

stagpy/phyvars.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Lists of physical variables made available by StagPy.
22
33
They are organized by kind of variables (field, profiles, and time series).
4-
EXTRA lists group variables that are not directly output by StagYY and need to
4+
`EXTRA` lists group variables that are not directly output by StagYY and need to
55
be computed from other variables.
66
"""
77

@@ -66,12 +66,14 @@
6666
"fFeR": Varf("fFeR", "1"),
6767
}
6868
)
69+
"""Scalar fields output by StagYY."""
6970

7071
FIELD_EXTRA: Mapping[str, Callable[[Step], Field]] = MappingProxyType(
7172
{
7273
"stream": processing.stream_function,
7374
}
7475
)
76+
"""Scalar fields that StagPy can compute."""
7577

7678
FIELD_FILES: Mapping[str, list[str]] = MappingProxyType(
7779
{
@@ -156,6 +158,7 @@
156158
"crust": Varf("Crustal thickness", "m"),
157159
}
158160
)
161+
"""Surface scalar fields output by StagYY."""
159162

160163
SFIELD_FILES: Mapping[str, list[str]] = MappingProxyType(
161164
{
@@ -255,6 +258,7 @@
255258
"advasc": Varr("Upward advection", "Heat flux", "W/m2"),
256259
}
257260
)
261+
"""Radial profiles output by StagYY."""
258262

259263
RPROF_EXTRA: Mapping[str, Callable[[Step], Rprof]] = MappingProxyType(
260264
{
@@ -270,6 +274,7 @@
270274
"advth": processing.advth,
271275
}
272276
)
277+
"""Radial profiles that StagPy can compute."""
273278

274279

275280
TIME: Mapping[str, Vart] = MappingProxyType(
@@ -305,6 +310,7 @@
305310
"botT_val": Vart("Temperature at bottom", "Temperature", "K"),
306311
}
307312
)
313+
"""Time series output by StagYY."""
308314

309315
TIME_EXTRA: Mapping[str, Callable[[StagyyData], Tseries]] = MappingProxyType(
310316
{
@@ -314,6 +320,7 @@
314320
"mobility": processing.mobility,
315321
}
316322
)
323+
"""Time series that StagPy can compute."""
317324

318325
REFSTATE: Mapping[str, Varr] = MappingProxyType(
319326
{
@@ -327,6 +334,7 @@
327334
"grav": Varr("Gravity", "Gravity", "m/s2"),
328335
}
329336
)
337+
"""Variables in [`Refstate`][stagpy.stagyydata.Refstate]."""
330338

331339
SCALES: Mapping[str, Callable[[Scales], float]] = MappingProxyType(
332340
{
@@ -346,5 +354,6 @@
346354
"m/s2": attrgetter("acceleration"),
347355
}
348356
)
357+
"""Scales to make values dimensional, see [`Scales`][stagpy.dimensions.Scales]."""
349358

350359
PREFIXES = ("k", "M", "G")

0 commit comments

Comments
 (0)