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

Method get_leaf_nodes

pywt/_wavelet_packets.py:336–356  ·  view source on GitHub ↗

Returns leaf nodes. Parameters ---------- decompose : bool, optional (default: True)

(self, decompose=False)

Source from the content-addressed store, hash-verified

334 return any(self._get_node(part) is not None for part in self.PARTS)
335
336 def get_leaf_nodes(self, decompose=False):
337 """
338 Returns leaf nodes.
339
340 Parameters
341 ----------
342 decompose : bool, optional
343 (default: True)
344 """
345 result = []
346
347 def collect(node):
348 if node.level == node.maxlevel and not node.is_empty:
349 result.append(node)
350 return False
351 if not decompose and not node.has_any_subnode:
352 result.append(node)
353 return False
354 return True
355 self.walk(collect, decompose=decompose)
356 return result
357
358 def walk(self, func, args=(), kwargs=None, decompose=True):
359 """

Callers 2

test_reconstructing_dataFunction · 0.80
test_removing_nodesFunction · 0.80

Calls 1

walkMethod · 0.95

Tested by 2

test_reconstructing_dataFunction · 0.64
test_removing_nodesFunction · 0.64