Skip to content

Commit a462b00

Browse files
committed
Update docstrings for observer to work with sphinx. Clearly distinguish between constructor args and attributes assigned based on those args (and 'locations' and 'times' which can be both)
1 parent 2f10eab commit a462b00

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

dabench/observer/_observer.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class Observer():
2020
"""Base class for Observer objects
2121
22-
Attributes:
22+
Args:
2323
data_obj: Data generator/loader object from which
2424
to gather observations.
2525
random_location_density: Fraction of locations in
@@ -74,6 +74,16 @@ class Observer():
7474
store_as_jax: Store values as jax array instead of numpy array.
7575
Default is False (store as numpy).
7676
77+
Attributes:
78+
locations (ArrayLike): Location indices for making
79+
observations. In system_dim (1D) or original dim
80+
(>1D) of self.state_vec.
81+
location_dim (int): Number of locations sampled from (max
82+
in a single time step, if non-stationary observers).
83+
times (ArrayLike): Time indices to gather observations
84+
from.
85+
time_dim (int): Number of times sampled from.
86+
7787
"""
7888

7989
def __init__(self,
@@ -353,4 +363,4 @@ def observe(self) -> xr.Dataset:
353363
obs_vec[data_var] = obs_vec[data_var] + obs_vec['errors'].sel(variable=data_var)
354364

355365

356-
return obs_vec
366+
return obs_vec

0 commit comments

Comments
 (0)