We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9240b7f commit c1c30e6Copy full SHA for c1c30e6
sfs/util.py
@@ -323,3 +323,14 @@ def setter(self, value):
323
z = make_property(2, doc='z-component (optional).')
324
325
del make_property
326
+
327
+ def apply(self, func, *args, **kwargs):
328
+ """Apply a function to each component.
329
330
+ The function `func` will be called once for each component,
331
+ passing the current component as first argument. All further
332
+ arguments are passed after that.
333
+ The results are returned as a new :class:`XyzComponents` object.
334
335
+ """
336
+ return XyzComponents([func(i, *args, **kwargs) for i in self])
0 commit comments