Skip to content

Commit b609919

Browse files
committed
compute_n_to_1: remove name argument
1 parent eb853a8 commit b609919

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

cdl/core/gui/processor/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,6 @@ def compute_1_to_0(
612612

613613
def compute_n_to_1(
614614
self,
615-
name: str,
616615
func: Callable,
617616
param: gds.DataSet | None = None,
618617
paramclass: gds.DataSet | None = None,
@@ -627,7 +626,6 @@ def compute_n_to_1(
627626
index) and generates one output per pair.
628627
629628
Args:
630-
name: Operation name (used for object titles).
631629
func: Function to apply, that takes either `(dst_obj, src_obj_list)` or
632630
`(dst_obj, src_obj_list, param)` as arguments, where `dst_obj` is the
633631
output object, `src_obj_list` is the input object list,
@@ -653,6 +651,7 @@ def compute_n_to_1(
653651
objs = self.panel.objview.get_sel_objects(include_groups=True)
654652
objmodel = self.panel.objmodel
655653
pairwise = is_pairwise_mode()
654+
name = func.__name__.replace("compute_", "")
656655

657656
if pairwise:
658657
src_grps, src_gids, src_objs, _nbobj, valid = (

cdl/core/gui/processor/image.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def compute_normalize(self, param: cpb.NormalizeParam | None = None) -> None:
5555
@qt_try_except()
5656
def compute_sum(self) -> None:
5757
"""Compute sum with :py:func:`cdl.computation.image.compute_addition`"""
58-
self.compute_n_to_1("Σ", cpi.compute_addition, title=_("Sum"))
58+
self.compute_n_to_1(cpi.compute_addition, title=_("Sum"))
5959

6060
@qt_try_except()
6161
def compute_addition_constant(self, param: cpb.ConstantParam | None = None) -> None:
@@ -72,12 +72,12 @@ def compute_addition_constant(self, param: cpb.ConstantParam | None = None) -> N
7272
def compute_average(self) -> None:
7373
"""Compute average with :py:func:`cdl.computation.image.compute_addition`
7474
and dividing by the number of images"""
75-
self.compute_n_to_1("µ", cpi.compute_average, title=_("Average"))
75+
self.compute_n_to_1(cpi.compute_average, title=_("Average"))
7676

7777
@qt_try_except()
7878
def compute_product(self) -> None:
7979
"""Compute product with :py:func:`cdl.computation.image.compute_product`"""
80-
self.compute_n_to_1("Π", cpi.compute_product, title=_("Product"))
80+
self.compute_n_to_1(cpi.compute_product, title=_("Product"))
8181

8282
@qt_try_except()
8383
def compute_product_constant(self, param: cpb.ConstantParam | None = None) -> None:

cdl/core/gui/processor/signal.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class SignalProcessor(BaseProcessor[SignalROI]):
4040
@qt_try_except()
4141
def compute_sum(self) -> None:
4242
"""Compute sum with :py:func:`cdl.computation.signal.compute_addition`"""
43-
self.compute_n_to_1("Σ", cps.compute_addition, title=_("Sum"))
43+
self.compute_n_to_1(cps.compute_addition, title=_("Sum"))
4444

4545
@qt_try_except()
4646
def compute_addition_constant(self, param: cpb.ConstantParam | None = None) -> None:
@@ -57,12 +57,12 @@ def compute_addition_constant(self, param: cpb.ConstantParam | None = None) -> N
5757
def compute_average(self) -> None:
5858
"""Compute average with :py:func:`cdl.computation.signal.compute_addition`
5959
and divide by the number of signals"""
60-
self.compute_n_to_1("µ", cps.compute_average, title=_("Average"))
60+
self.compute_n_to_1(cps.compute_average, title=_("Average"))
6161

6262
@qt_try_except()
6363
def compute_product(self) -> None:
6464
"""Compute product with :py:func:`cdl.computation.signal.compute_product`"""
65-
self.compute_n_to_1("Π", cps.compute_product, title=_("Product"))
65+
self.compute_n_to_1(cps.compute_product, title=_("Product"))
6666

6767
@qt_try_except()
6868
def compute_product_constant(self, param: cpb.ConstantParam | None = None) -> None:

0 commit comments

Comments
 (0)