Skip to content

Commit

Permalink
Update move_accessor.py docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
lochhh committed Aug 7, 2024
1 parent 8c51e87 commit cdf0550
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions movement/move_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class MovementDataset:
Attributes
----------
dim_names_per_ds_type : dict
dim_names : dict
A dictionary with the names of the expected dimensions in the dataset,
for each dataset type (``"poses"`` or ``"bboxes"``).
var_names_per_ds_type : dict
var_names : dict
A dictionary with the expected data variables in the dataset, for each
dataset type (``"poses"`` or ``"bboxes"``).
Expand All @@ -57,7 +57,6 @@ class MovementDataset:
def __init__(self, ds: xr.Dataset):
"""Initialize the MovementDataset."""
self._obj = ds

# Set instance attributes based on dataset type
self.dim_names_instance = self.dim_names[self._obj.ds_type]
self.var_names_instance = self.var_names[self._obj.ds_type]
Expand Down Expand Up @@ -258,7 +257,6 @@ def validate(self) -> None:
try:
self._validate_dims()
self._validate_data_vars()

if self._obj.ds_type == "poses":
ValidPosesDataset(
position_array=self._obj["position"].values,
Expand All @@ -274,7 +272,6 @@ def validate(self) -> None:
frame_array = self._obj.coords["time"].values.reshape(-1, 1)
if self._obj.attrs["time_unit"] == "seconds":
frame_array *= fps

ValidBboxesDataset(
position_array=self._obj["position"].values,
shape_array=self._obj["shape"].values,
Expand All @@ -286,8 +283,7 @@ def validate(self) -> None:
)
except Exception as e:
error_msg = (
f"The dataset does not contain valid {self._obj.ds_type}. "
+ str(e)
f"The dataset does not contain valid {self._obj.ds_type}. {e}"
)
raise log_error(ValueError, error_msg) from e

Expand Down

0 comments on commit cdf0550

Please sign in to comment.