Skip to content

Commit

Permalink
Fix newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
lochhh committed Jan 21, 2025
1 parent 47dbb70 commit cc622b9
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 61 deletions.
4 changes: 1 addition & 3 deletions tests/test_integration/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ def test_save_and_load_dlc_file(
loading them back in returns the same Dataset.
"""
save_poses.to_dlc_file(
valid_poses_dataset,
dlc_output_file,
split_individuals=False,
valid_poses_dataset, dlc_output_file, split_individuals=False
)
ds = load_poses.from_dlc_file(dlc_output_file)
xr.testing.assert_allclose(ds, valid_poses_dataset)
Expand Down
5 changes: 1 addition & 4 deletions tests/test_integration/test_kinematics_vector_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

@pytest.mark.parametrize(
"valid_dataset_uniform_linear_motion",
[
"valid_poses_dataset",
"valid_bboxes_dataset",
],
["valid_poses_dataset", "valid_bboxes_dataset"],
)
@pytest.mark.parametrize(
"kinematic_variable, expected_kinematics_polar",
Expand Down
5 changes: 1 addition & 4 deletions tests/test_unit/test_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ def test_filter_with_nans_on_position(
"""
# Expected number of nans in the position array per individual
expected_nans_in_filtered_position_per_indiv = {
"valid_poses_dataset": [
0,
0,
], # no nans in input
"valid_poses_dataset": [0, 0], # no nans in input
"valid_bboxes_dataset": [0, 0], # no nans in input
"valid_poses_dataset_with_nan": [38, 0],
"valid_bboxes_dataset_with_nan": [14, 0],
Expand Down
26 changes: 5 additions & 21 deletions tests/test_unit/test_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

@pytest.mark.parametrize(
"valid_dataset_uniform_linear_motion",
[
"valid_poses_dataset",
"valid_bboxes_dataset",
],
["valid_poses_dataset", "valid_bboxes_dataset"],
)
@pytest.mark.parametrize(
"kinematic_variable, expected_kinematics",
Expand Down Expand Up @@ -90,10 +87,7 @@ def test_kinematics_uniform_linear_motion(

@pytest.mark.parametrize(
"valid_dataset_with_nan",
[
"valid_poses_dataset_with_nan",
"valid_bboxes_dataset_with_nan",
],
["valid_poses_dataset_with_nan", "valid_bboxes_dataset_with_nan"],
)
@pytest.mark.parametrize(
"kinematic_variable, expected_nans_per_individual",
Expand Down Expand Up @@ -222,10 +216,7 @@ def test_approximate_derivative_with_invalid_order(order):
],
)
def test_path_length_across_time_ranges(
valid_poses_dataset,
start,
stop,
expected_exception,
valid_poses_dataset, start, stop, expected_exception
):
"""Test path length computation for a uniform linear motion case,
across different time ranges.
Expand Down Expand Up @@ -568,10 +559,7 @@ def test_cdist_with_known_values(dim, expected_data, valid_poses_dataset):

@pytest.mark.parametrize(
"valid_dataset",
[
"valid_poses_dataset",
"valid_bboxes_dataset",
],
["valid_poses_dataset", "valid_bboxes_dataset"],
)
@pytest.mark.parametrize(
"selection_fn",
Expand Down Expand Up @@ -694,11 +682,7 @@ def test_compute_pairwise_distances_with_valid_pairs(
"keypoints",
"invalid_string",
), # invalid pairs
(
"valid_poses_dataset",
"individuals",
{},
), # empty pairs
("valid_poses_dataset", "individuals", {}), # empty pairs
("missing_dim_poses_dataset", "keypoints", "all"), # invalid dataset
(
"missing_dim_bboxes_dataset",
Expand Down
5 changes: 1 addition & 4 deletions tests/test_unit/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ def test_log_warning(caplog):

@pytest.mark.parametrize(
"input_data",
[
"valid_poses_dataset",
"valid_bboxes_dataset",
],
["valid_poses_dataset", "valid_bboxes_dataset"],
)
@pytest.mark.parametrize(
"selector_fn, expected_selector_type",
Expand Down
5 changes: 1 addition & 4 deletions tests/test_unit/test_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ def test_report_nan_values_in_position_selecting_individual(

@pytest.mark.parametrize(
"valid_dataset",
[
"valid_poses_dataset",
"valid_poses_dataset_with_nan",
],
["valid_poses_dataset", "valid_poses_dataset_with_nan"],
)
@pytest.mark.parametrize(
"data_selection, expected_keypoints, expected_individuals",
Expand Down
23 changes: 5 additions & 18 deletions tests/test_unit/test_save_poses.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@ def test_to_dlc_style_df(self, ds, expected_exception):
]

def test_to_dlc_file_valid_dataset(
self,
output_file_params,
valid_poses_dataset,
request,
self, output_file_params, valid_poses_dataset, request
):
"""Test that saving a valid pose dataset to a valid/invalid
DeepLabCut-style file returns the appropriate errors.
Expand Down Expand Up @@ -178,9 +175,7 @@ def test_auto_split_individuals(self, valid_poses_dataset, split_value):
indirect=["valid_poses_dataset"],
)
def test_to_dlc_style_df_split_individuals(
self,
valid_poses_dataset,
split_individuals,
self, valid_poses_dataset, split_individuals
):
"""Test that the `split_individuals` argument affects the behaviour
of the `to_dlc_style_df` function as expected.
Expand Down Expand Up @@ -234,9 +229,7 @@ def test_to_dlc_file_split_individuals(
"""
with expected_exception:
save_poses.to_dlc_file(
valid_poses_dataset,
new_h5_file,
split_individuals,
valid_poses_dataset, new_h5_file, split_individuals
)
# Get the names of the individuals in the dataset
ind_names = valid_poses_dataset.individuals.values
Expand All @@ -255,10 +248,7 @@ def test_to_dlc_file_split_individuals(
file_path_ind.unlink()

def test_to_lp_file_valid_dataset(
self,
output_file_params,
valid_poses_dataset,
request,
self, output_file_params, valid_poses_dataset, request
):
"""Test that saving a valid pose dataset to a valid/invalid
LightningPose-style file returns the appropriate errors.
Expand Down Expand Up @@ -286,10 +276,7 @@ def test_to_lp_file_invalid_dataset(
)

def test_to_sleap_analysis_file_valid_dataset(
self,
output_file_params,
valid_poses_dataset,
request,
self, output_file_params, valid_poses_dataset, request
):
"""Test that saving a valid pose dataset to a valid/invalid
SLEAP-style file returns the appropriate errors.
Expand Down
4 changes: 1 addition & 3 deletions tests/test_unit/test_validators/test_array_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ def expect_value_error_with_message(error_msg):
valid_cases + invalid_cases,
)
def test_validate_dims_coords(
valid_poses_dataset, # fixture from conftest.py
required_dims_coords,
expected_exception,
valid_poses_dataset, required_dims_coords, expected_exception
):
"""Test validate_dims_coords for both valid and invalid inputs."""
position_array = valid_poses_dataset["position"]
Expand Down

0 comments on commit cc622b9

Please sign in to comment.