Skip to content

Commit 7c0b12c

Browse files
committed
Refactor fixtures
1 parent aebf91f commit 7c0b12c

File tree

4 files changed

+195
-249
lines changed

4 files changed

+195
-249
lines changed

tests/fixtures/datasets.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1-
"""Valid and invalid movement datasets and arrays fixtures."""
1+
"""Valid and invalid data fixtures."""
22

33
import numpy as np
4+
import pandas as pd
45
import pytest
56
import xarray as xr
67

78
from movement.validators.datasets import ValidBboxesDataset, ValidPosesDataset
89

910

11+
# -------------------- Valid DLC-style DataFrame --------------------
12+
@pytest.fixture
13+
def dlc_style_df():
14+
"""Return a valid DLC-style DataFrame."""
15+
return pd.read_hdf(pytest.DATA_PATHS.get("DLC_single-wasp.predictions.h5"))
16+
17+
1018
# -------------------- Valid bboxes datasets and arrays --------------------
1119
@pytest.fixture
1220
def valid_bboxes_arrays_all_zeros():
@@ -285,24 +293,13 @@ def valid_poses_dataset_with_nan(valid_poses_dataset):
285293
- Individual "id_1" has no missing values.
286294
"""
287295
valid_poses_dataset.position.loc[
288-
{
289-
"individuals": "id_0",
290-
"keypoints": "centroid",
291-
"time": 0,
292-
}
296+
{"individuals": "id_0", "keypoints": "centroid", "time": 0}
293297
] = np.nan
294298
valid_poses_dataset.position.loc[
295-
{
296-
"individuals": "id_0",
297-
"keypoints": "left",
298-
"time": [3, 7, 8],
299-
}
299+
{"individuals": "id_0", "keypoints": "left", "time": [3, 7, 8]}
300300
] = np.nan
301301
valid_poses_dataset.position.loc[
302-
{
303-
"individuals": "id_0",
304-
"keypoints": "right",
305-
}
302+
{"individuals": "id_0", "keypoints": "right"}
306303
] = np.nan
307304
return valid_poses_dataset
308305

0 commit comments

Comments
 (0)