Skip to content

Commit 9313b9d

Browse files
committed
SonarCloud warning fixes
1 parent 7d61af5 commit 9313b9d

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

tests/test_unit/test_kinematics/test_collective.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,8 @@ def test_polarization_is_invariant_to_translation(
554554
):
555555
"""Adding a constant offset does not change polarization."""
556556
shifted = partial_alignment_positions.copy()
557-
shifted.loc[dict(space="x")] = shifted.sel(space="x") + 1000.0
558-
shifted.loc[dict(space="y")] = shifted.sel(space="y") - 500.0
557+
shifted.loc[{"space": "x"}] = shifted.sel(space="x") + 1000.0
558+
shifted.loc[{"space": "y"}] = shifted.sel(space="y") - 500.0
559559

560560
pol_original = kinematics.compute_polarization(
561561
partial_alignment_positions
@@ -597,8 +597,8 @@ def test_polarization_is_invariant_to_global_rotation(
597597
y = partial_alignment_positions.sel(space="y")
598598

599599
rotated = partial_alignment_positions.copy()
600-
rotated.loc[dict(space="x")] = -y
601-
rotated.loc[dict(space="y")] = x
600+
rotated.loc[{"space": "x"}] = -y
601+
rotated.loc[{"space": "y"}] = x
602602

603603
pol_original = kinematics.compute_polarization(
604604
partial_alignment_positions
@@ -660,8 +660,8 @@ def test_body_axis_invariance_to_translation_scaling_rotation(
660660

661661
# Global translation: should not affect body-axis vectors.
662662
translated = da.copy()
663-
translated.loc[dict(space="x")] = translated.sel(space="x") + 123.4
664-
translated.loc[dict(space="y")] = translated.sel(space="y") - 56.7
663+
translated.loc[{"space": "x"}] = translated.sel(space="x") + 123.4
664+
translated.loc[{"space": "y"}] = translated.sel(space="y") - 56.7
665665

666666
pol_translated, angle_translated = kinematics.compute_polarization(
667667
translated,
@@ -698,8 +698,8 @@ def test_body_axis_invariance_to_translation_scaling_rotation(
698698
rotated = da.copy()
699699
x = da.sel(space="x")
700700
y = da.sel(space="y")
701-
rotated.loc[dict(space="x")] = -y
702-
rotated.loc[dict(space="y")] = x
701+
rotated.loc[{"space": "x"}] = -y
702+
rotated.loc[{"space": "y"}] = x
703703

704704
pol_rotated, angle_rotated = kinematics.compute_polarization(
705705
rotated,
@@ -1060,8 +1060,8 @@ def test_mean_angle_rotates_with_global_rotation(
10601060
y = partial_alignment_positions.sel(space="y")
10611061

10621062
rotated = partial_alignment_positions.copy()
1063-
rotated.loc[dict(space="x")] = -y
1064-
rotated.loc[dict(space="y")] = x
1063+
rotated.loc[{"space": "x"}] = -y
1064+
rotated.loc[{"space": "y"}] = x
10651065

10661066
_, angle_rotated = kinematics.compute_polarization(
10671067
rotated,

0 commit comments

Comments
 (0)