Skip to content

Commit

Permalink
Merge branch 'main' into wgraham-base-rois
Browse files Browse the repository at this point in the history
  • Loading branch information
willGraham01 committed Feb 4, 2025
2 parents 046b3a5 + 25a3717 commit 15b97b8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.4
hooks:
- id: ruff
- id: ruff-format
Expand All @@ -53,7 +53,7 @@ repos:
additional_dependencies: [setuptools-scm, wheel]
- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in pyproject.toml
rev: v2.3.0
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies:
Expand Down
3 changes: 1 addition & 2 deletions movement/kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,7 @@ def compute_pairwise_distances(
paired_elements = [
(elem1, elem2)
for elem1, elem2_list in pairs.items()
for elem2 in
(
for elem2 in (
# Ensure elem2_list is a list
[elem2_list] if isinstance(elem2_list, str) else elem2_list
)
Expand Down
2 changes: 1 addition & 1 deletion movement/validators/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _file_is_h5(self, attribute, value):
except Exception as e:
raise log_error(
ValueError,
f"File {value} does not seem to be in valid" "HDF5 format.",
f"File {value} does not seem to be in validHDF5 format.",
) from e

@path.validator
Expand Down
6 changes: 3 additions & 3 deletions tests/test_unit/test_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,9 @@ def test_nan_behavior_forward_vector(
# Should have NaN values in the forward vector at time 1 and left_ear
nan_values = forward_vector.sel(time=nan_time)
assert nan_values.shape == (1, 2)
assert np.isnan(
nan_values
).all(), "NaN values not returned where expected!"
assert np.isnan(nan_values).all(), (
"NaN values not returned where expected!"
)
# Should have no NaN values in the forward vector in other positions
assert not np.isnan(
forward_vector.sel(
Expand Down
18 changes: 9 additions & 9 deletions tests/test_unit/test_sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ def validate_metadata(metadata: dict[str, dict]) -> None:
"note",
]
check_yaml_msg = "Check the format of the metadata .yaml file."
assert isinstance(
metadata, dict
), f"Expected metadata to be a dictionary. {check_yaml_msg}"
assert all(
isinstance(ds, str) for ds in metadata
), f"Expected metadata keys to be strings. {check_yaml_msg}"
assert all(
isinstance(val, dict) for val in metadata.values()
), f"Expected metadata values to be dicts. {check_yaml_msg}"
assert isinstance(metadata, dict), (
f"Expected metadata to be a dictionary. {check_yaml_msg}"
)
assert all(isinstance(ds, str) for ds in metadata), (
f"Expected metadata keys to be strings. {check_yaml_msg}"
)
assert all(isinstance(val, dict) for val in metadata.values()), (
f"Expected metadata values to be dicts. {check_yaml_msg}"
)
assert all(
set(val.keys()) == set(metadata_fields) for val in metadata.values()
), f"Found issues with the names of metadata fields. {check_yaml_msg}"
Expand Down

0 comments on commit 15b97b8

Please sign in to comment.