MCPcopy Create free account
hub / github.com/PyWavelets/pywt / walk_depth

Method walk_depth

pywt/_wavelet_packets.py:385–409  ·  view source on GitHub ↗

Walk tree and call func on every node starting from the bottom-most nodes. Parameters ---------- func : callable Callable accepting :class:`BaseNode` as the first param and optional positional and keyword arguments args :

(self, func, args=(), kwargs=None, decompose=True)

Source from the content-addressed store, hash-verified

383 subnode.walk(func, args, kwargs, decompose)
384
385 def walk_depth(self, func, args=(), kwargs=None, decompose=True):
386 """
387 Walk tree and call func on every node starting from the bottom-most
388 nodes.
389
390 Parameters
391 ----------
392 func : callable
393 Callable accepting :class:`BaseNode` as the first param and
394 optional positional and keyword arguments
395 args :
396 func params
397 kwargs :
398 func keyword params
399 decompose : bool, optional
400 (default: False)
401 """
402 if kwargs is None:
403 kwargs = {}
404 if self.level < self.maxlevel:
405 for part in self.PARTS:
406 subnode = self.get_subnode(part, decompose)
407 if subnode is not None:
408 subnode.walk_depth(func, args, kwargs, decompose)
409 func(self, *args, **kwargs)
410
411 def __str__(self):
412 return self.path + ": " + str(self.data)

Callers

nothing calls this directly

Calls 1

get_subnodeMethod · 0.95

Tested by

no test coverage detected