Skip to content

Commit df4006d

Browse files
committed
Fix validation status renaming issues
1 parent b67d910 commit df4006d

File tree

14 files changed

+227
-370
lines changed

14 files changed

+227
-370
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ See DataLab [roadmap page](https://datalab-platform.com/en/contributing/roadmap.
1010
* Added new `@computation_function` decorator to mark and register computation functions
1111
* Renamed computation functions to remove redundant "compute_" prefix (e.g., `compute_fft``fft`)
1212
* Added infrastructure for discovering computation functions via introspection
13-
* Improved function naming in coordinate transformations (e.g., `cartesian2polar``to_polar`)
13+
* Improved function naming in coordinate transformations (e.g., `to_polar``to_polar`)
1414
* Added type hints and improved documentation across computation modules
1515
* These changes improve code organization and maintainability while making the API more intuitive
1616
* Internal changes only - **no backward compatibility is maintained** for plugin developers

cdl/tests/features/images/operation_unit_test.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,23 @@ def __create_n_images(n: int = 100) -> list[cdl.obj.ImageObj]:
6868

6969

7070
@pytest.mark.validation
71-
def test_image_sum() -> None:
72-
"""Image sum test."""
73-
execenv.print("*** Testing image sum:")
71+
def test_image_addition() -> None:
72+
"""Image addition test."""
73+
execenv.print("*** Testing image addition:")
7474
for ima1, ima2 in __iterate_image_couples():
7575
dtype1, dtype2 = ima1.data.dtype, ima2.data.dtype
7676
execenv.print(f" {dtype1} += {dtype2}: ", end="")
7777
exp = ima1.data.astype(float) + ima2.data.astype(float)
7878
ima3 = cpi.addition([ima1, ima2])
79-
check_array_result("Image sum", ima3.data, exp)
79+
check_array_result("Image addition", ima3.data, exp)
8080
imalist = __create_n_images()
8181
n = len(imalist)
8282
ima3 = cpi.addition(imalist)
8383
res = ima3.data
8484
exp = np.zeros_like(ima3.data)
8585
for ima in imalist:
8686
exp += ima.data
87-
check_array_result(f" Sum of {n} images", res, exp)
87+
check_array_result(f" Addition of {n} images", res, exp)
8888

8989

9090
@pytest.mark.validation
@@ -289,36 +289,36 @@ def test_image_inverse() -> None:
289289

290290

291291
@pytest.mark.validation
292-
def test_image_abs() -> None:
292+
def test_image_absolute() -> None:
293293
"""Image absolute value test."""
294294
execenv.print("*** Testing image absolute value:")
295295
for ima1 in __iterate_images():
296296
execenv.print(f" abs({ima1.data.dtype}): ", end="")
297297
exp = np.abs(ima1.data)
298298
ima2 = cpi.absolute(ima1)
299-
check_array_result("Image abs", ima2.data, exp)
299+
check_array_result("Absolute value", ima2.data, exp)
300300

301301

302302
@pytest.mark.validation
303-
def test_image_re() -> None:
303+
def test_image_real() -> None:
304304
"""Image real part test."""
305305
execenv.print("*** Testing image real part:")
306306
for ima1 in __iterate_images():
307307
execenv.print(f" re({ima1.data.dtype}): ", end="")
308308
exp = np.real(ima1.data)
309309
ima2 = cpi.real(ima1)
310-
check_array_result("Image re", ima2.data, exp)
310+
check_array_result("Real part", ima2.data, exp)
311311

312312

313313
@pytest.mark.validation
314-
def test_image_im() -> None:
314+
def test_image_imag() -> None:
315315
"""Image imaginary part test."""
316316
execenv.print("*** Testing image imaginary part:")
317317
for ima1 in __iterate_images():
318318
execenv.print(f" im({ima1.data.dtype}): ", end="")
319319
exp = np.imag(ima1.data)
320320
ima2 = cpi.imag(ima1)
321-
check_array_result("Image im", ima2.data, exp)
321+
check_array_result("Imaginary part", ima2.data, exp)
322322

323323

324324
def __get_numpy_info(dtype: np.dtype) -> np.generic:
@@ -449,7 +449,7 @@ def test_image_rotate() -> None:
449449

450450

451451
if __name__ == "__main__":
452-
test_image_sum()
452+
test_image_addition()
453453
test_image_average()
454454
test_image_product()
455455
test_image_division()
@@ -461,9 +461,9 @@ def test_image_rotate() -> None:
461461
test_image_division_constant()
462462
test_image_arithmetic()
463463
test_image_inverse()
464-
test_image_abs()
465-
test_image_re()
466-
test_image_im()
464+
test_image_absolute()
465+
test_image_real()
466+
test_image_imag()
467467
test_image_astype()
468468
test_image_exp()
469469
test_image_log10()

cdl/tests/features/signals/operation_unit_test.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ def __create_one_signal_and_constant() -> tuple[
5353

5454

5555
@pytest.mark.validation
56-
def test_signal_sum() -> None:
57-
"""Signal sum test."""
56+
def test_signal_addition() -> None:
57+
"""Signal addition test."""
5858
slist = __create_n_signals()
5959
n = len(slist)
6060
s3 = cps.addition(slist)
6161
res = s3.y
6262
exp = np.zeros_like(s3.y)
6363
for s in slist:
6464
exp += s.y
65-
check_array_result(f"Sum of {n} signals", res, exp)
65+
check_array_result(f"Addition of {n} signals", res, exp)
6666

6767

6868
@pytest.mark.validation
@@ -161,23 +161,23 @@ def test_signal_inverse() -> None:
161161

162162

163163
@pytest.mark.validation
164-
def test_signal_abs() -> None:
164+
def test_signal_absolute() -> None:
165165
"""Absolute value validation test."""
166166
s1 = __create_two_signals()[0]
167167
abs_signal = cps.absolute(s1)
168168
check_array_result("Absolute value", abs_signal.y, np.abs(s1.y))
169169

170170

171171
@pytest.mark.validation
172-
def test_signal_re() -> None:
172+
def test_signal_real() -> None:
173173
"""Real part validation test."""
174174
s1 = __create_two_signals()[0]
175175
re_signal = cps.real(s1)
176176
check_array_result("Real part", re_signal.y, np.real(s1.y))
177177

178178

179179
@pytest.mark.validation
180-
def test_signal_im() -> None:
180+
def test_signal_imag() -> None:
181181
"""Imaginary part validation test."""
182182
s1 = __create_two_signals()[0]
183183
im_signal = cps.imag(s1)
@@ -252,7 +252,7 @@ def test_signal_arithmetic() -> None:
252252

253253

254254
if __name__ == "__main__":
255-
test_signal_sum()
255+
test_signal_addition()
256256
test_signal_average()
257257
test_signal_product()
258258
test_signal_difference()
@@ -263,9 +263,9 @@ def test_signal_arithmetic() -> None:
263263
test_signal_difference_constant()
264264
test_signal_division_constant()
265265
test_signal_inverse()
266-
test_signal_abs()
267-
test_signal_re()
268-
test_signal_im()
266+
test_signal_absolute()
267+
test_signal_real()
268+
test_signal_imag()
269269
test_signal_astype()
270270
test_signal_exp()
271271
test_signal_log10()

cdl/tests/features/signals/processing_unit_test.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def test_signal_reverse_x() -> None:
8282
check_array_result("ReverseX", dst.data, exp)
8383

8484

85-
def test_cartesian2polar() -> None:
85+
def test_to_polar() -> None:
8686
"""Unit test for the cartesian to polar conversion."""
8787
title = "Cartesian2Polar"
8888
x = np.array([0.0, 1.0, 2.0, 3.0, 4.0])
@@ -100,7 +100,7 @@ def test_cartesian2polar() -> None:
100100
check_array_result(f"{title}|theta", theta, exp_theta)
101101

102102

103-
def test_polar2cartesian() -> None:
103+
def test_to_cartesian() -> None:
104104
"""Unit test for the polar to cartesian conversion."""
105105
title = "Polar2Cartesian"
106106
r = np.array([0.0, np.sqrt(2.0), np.sqrt(8.0), np.sqrt(18.0), np.sqrt(32.0)])
@@ -119,7 +119,7 @@ def test_polar2cartesian() -> None:
119119

120120

121121
@pytest.mark.validation
122-
def test_signal_cartesian2polar() -> None:
122+
def test_signal_to_polar() -> None:
123123
"""Validation test for the signal cartesian to polar processing."""
124124
title = "Cartesian2Polar"
125125
p = cdl.param.AngleUnitParam()
@@ -135,7 +135,7 @@ def test_signal_cartesian2polar() -> None:
135135

136136

137137
@pytest.mark.validation
138-
def test_signal_polar2cartesian() -> None:
138+
def test_signal_to_cartesian() -> None:
139139
"""Validation test for the signal polar to cartesian processing."""
140140
title = "Polar2Cartesian"
141141
p = cdl.param.AngleUnitParam()
@@ -382,10 +382,10 @@ def test_signal_XY_mode() -> None:
382382
if __name__ == "__main__":
383383
test_signal_calibration()
384384
test_signal_swap_axes()
385-
test_cartesian2polar()
386-
test_polar2cartesian()
387-
test_signal_cartesian2polar()
388-
test_signal_polar2cartesian()
385+
test_to_polar()
386+
test_to_cartesian()
387+
test_signal_to_polar()
388+
test_signal_to_cartesian()
389389
test_signal_reverse_x()
390390
test_signal_normalize()
391391
test_signal_clip()

doc/locale/fr/LC_MESSAGES/api/proxy.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ msgstr ""
605605
msgid "Compute data linear calibration"
606606
msgstr ""
607607

608-
msgid ":py:func:`~cdl.core.gui.processor.signal.SignalProcessor.compute_cartesian2polar`"
608+
msgid ":py:func:`~cdl.core.gui.processor.signal.SignalProcessor.compute_to_polar`"
609609
msgstr ""
610610

611611
msgid "Convert cartesian to polar coordinates"
@@ -830,7 +830,7 @@ msgstr ""
830830
msgid "Compute phase spectrum"
831831
msgstr ""
832832

833-
msgid ":py:func:`~cdl.core.gui.processor.signal.SignalProcessor.compute_polar2cartesian`"
833+
msgid ":py:func:`~cdl.core.gui.processor.signal.SignalProcessor.compute_to_cartesian`"
834834
msgstr ""
835835

836836
msgid "Convert polar to cartesian coordinates"

doc/locale/fr/LC_MESSAGES/contributing/changelog.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ msgstr "Renommé les fonctions de calcul pour supprimer le préfixe redondant \"
4242
msgid "Added infrastructure for discovering computation functions via introspection"
4343
msgstr "Ajout d'une infrastructure pour découvrir les fonctions de calcul via l'introspection"
4444

45-
msgid "Improved function naming in coordinate transformations (e.g., `cartesian2polar` ➝ `to_polar`)"
46-
msgstr "Amélioration de la nomination des fonctions dans les transformations de coordonnées (par exemple, `cartesian2polar` ➝ `to_polar`)"
45+
msgid "Improved function naming in coordinate transformations (e.g., `to_polar` ➝ `to_polar`)"
46+
msgstr "Amélioration de la nomination des fonctions dans les transformations de coordonnées (par exemple, `to_polar` ➝ `to_polar`)"
4747

4848
msgid "Added type hints and improved documentation across computation modules"
4949
msgstr "Ajout de types d'indices et amélioration de la documentation dans les modules de calcul"

doc/locale/fr/LC_MESSAGES/features/general/remote.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,10 +587,10 @@ msgstr ""
587587
msgid "Reverse X axis with :py:func:`cdl.computation.signal.compute_reverse_x`"
588588
msgstr ""
589589

590-
msgid "Convert cartesian to polar coordinates with :py:func:`cdl.computation.signal.compute_cartesian2polar`"
590+
msgid "Convert cartesian to polar coordinates with :py:func:`cdl.computation.signal.compute_to_polar`"
591591
msgstr ""
592592

593-
msgid "Convert polar to cartesian coordinates with :py:func:`cdl.computation.signal.compute_polar2cartesian`."
593+
msgid "Convert polar to cartesian coordinates with :py:func:`cdl.computation.signal.compute_to_cartesian`."
594594
msgstr ""
595595

596596
msgid "Normalize data with :py:func:`cdl.computation.signal.compute_normalize`"

doc/locale/fr/LC_MESSAGES/features/validation/status.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,13 @@ msgstr ""
208208
msgid "`test_signal_calibration <https://github.com/DataLab-Platform/DataLab/blob/v0.20.0/cdl/tests/features/signals/processing_unit_test.py#L36>`_"
209209
msgstr ""
210210

211-
msgid ":py:func:`compute_cartesian2polar <cdl.computation.signal.compute_cartesian2polar>`"
211+
msgid ":py:func:`compute_to_polar <cdl.computation.signal.compute_to_polar>`"
212212
msgstr ""
213213

214214
msgid "Convert cartesian coordinates to polar coordinates"
215215
msgstr ""
216216

217-
msgid "`test_signal_cartesian2polar <https://github.com/DataLab-Platform/DataLab/blob/v0.20.0/cdl/tests/features/signals/processing_unit_test.py#L121>`_"
217+
msgid "`test_signal_to_polar <https://github.com/DataLab-Platform/DataLab/blob/v0.20.0/cdl/tests/features/signals/processing_unit_test.py#L121>`_"
218218
msgstr ""
219219

220220
msgid ":py:func:`compute_clip <cdl.computation.signal.compute_clip>`"
@@ -502,13 +502,13 @@ msgstr ""
502502
msgid "`test_signal_phase_spectrum <https://github.com/DataLab-Platform/DataLab/blob/v0.20.0/cdl/tests/features/signals/fft1d_unit_test.py#L161>`_"
503503
msgstr ""
504504

505-
msgid ":py:func:`compute_polar2cartesian <cdl.computation.signal.compute_polar2cartesian>`"
505+
msgid ":py:func:`compute_to_cartesian <cdl.computation.signal.compute_to_cartesian>`"
506506
msgstr ""
507507

508508
msgid "Convert polar coordinates to cartesian coordinates"
509509
msgstr ""
510510

511-
msgid "`test_signal_polar2cartesian <https://github.com/DataLab-Platform/DataLab/blob/v0.20.0/cdl/tests/features/signals/processing_unit_test.py#L137>`_"
511+
msgid "`test_signal_to_cartesian <https://github.com/DataLab-Platform/DataLab/blob/v0.20.0/cdl/tests/features/signals/processing_unit_test.py#L137>`_"
512512
msgstr ""
513513

514514
msgid ":py:func:`compute_power <cdl.computation.signal.compute_power>`"

0 commit comments

Comments
 (0)