[Python-modules-team] Bug#510920: python-pywt: AttributeError exception while trying to wp.get_level after some pruning

Yaroslav Halchenko debian at onerussian.com
Mon Jan 5 23:41:25 UTC 2009


Package: python-pywt
Version: 0.1.7~svn97-1
Severity: normal


if you get an example from 
www.pybytes.com/pywavelets/demo/wp_simple_compression.py

and add at the end a line

d = wp.get_level(4, "freq")

you would get (after running and possibly replacing arrayrange to arange
if you have up-to-date matplotlib):

,--
| ...
| Retaining 99.93% energy
| Traceback (most recent call last):
|   File "wp_simple_compression_2.py", line 54, in <module>
|     d = wp.get_level(4, "freq")
|   File "/usr/lib/python2.5/site-packages/pywt/wavelet_packets.py", line 318, in get_level
|     self.walk(collect)
|   File "/usr/lib/python2.5/site-packages/pywt/wavelet_packets.py", line 292, in walk
|     self.getChild("d").walk(func, args)
|   File "/usr/lib/python2.5/site-packages/pywt/wavelet_packets.py", line 178, in walk
|     a.walk(func, args)
| AttributeError: 'NoneType' object has no attribute 'walk'
|
`---

so get_level (or walk) has no clue how to behave nicely if some nodes
were pruned

For your convinience I am attaching that script with line added and
modification in place to run it on sid

Also I put another remark with XXX since it seems to me that logic is not correct:

,---
| ## simple energy based criteria, not very efficient
| def select(node, min_energy):
|     # XXX shouldn't either both be with log or none of them?
|         if node.energy() < math.log(min_energy):
`---

Thank you in advance for looking at it, or simply forward it upstream please


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (991, 'testing'), (990, 'unstable'), (300, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages python-pywt depends on:
ii  libc6                         2.7-15     GNU C Library: Shared libraries
ii  python                        2.5.2-2    An interactive high-level object-o
ii  python-central                0.6.8      register and build utility for Pyt
ii  python-numpy                  1:1.1.0-3  Numerical Python adds a fast array

python-pywt recommends no packages.

python-pywt suggests no packages.

-- debconf-show failed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wp_simple_compression_2.py
Type: text/x-java
Size: 1526 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20090105/ff2f0373/attachment-0001.java 


More information about the Python-modules-team mailing list