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

Method _reconstruct

pywt/_wavelet_packets.py:661–680  ·  view source on GitHub ↗
(self, update)

Source from the content-addressed store, hash-verified

659 return (self._get_node(key) for key in self.PARTS)
660
661 def _reconstruct(self, update):
662 coeffs = {key: None for key in self.PARTS}
663
664 nnodes = 0
665 for key in self.PARTS:
666 node = self._get_node(key)
667 if node is not None:
668 nnodes += 1
669 coeffs[key] = node.reconstruct()
670
671 if nnodes == 0:
672 raise ValueError(
673 "Tree is missing data - all subnodes of `%s` node "
674 "are None. Cannot reconstruct node." % self.path
675 )
676 else:
677 rec = idwtn(coeffs, self.wavelet, self.mode, axes=self.axes)
678 if update:
679 self.data = rec
680 return rec
681
682
683class WaveletPacket(Node):

Callers

nothing calls this directly

Calls 3

_get_nodeMethod · 0.95
idwtnFunction · 0.85
reconstructMethod · 0.45

Tested by

no test coverage detected