New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: add default nlevels to wavelet trafo, closes #866 #880
ENH: add default nlevels to wavelet trafo, closes #866 #880
Conversation
odl/trafos/backends/pywt_bindings.py
Outdated
>>> pywt_max_nlevels([10, 1024], 'haar') | ||
3 | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra line, remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor things, good to go when fixed
odl/trafos/backends/pywt_bindings.py
Outdated
|
||
Parameters | ||
---------- | ||
shape : sequence |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sequence of ints
odl/trafos/backends/pywt_bindings.py
Outdated
@@ -180,6 +180,48 @@ def pywt_coeff_shapes(shape, wavelet, nlevels, mode): | |||
return shape_list | |||
|
|||
|
|||
def pywt_max_nlevels(shape, wavelet): | |||
"""Return the maximum nlevels option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this try to say?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "Return the maximum number of wavelet levels" better?
I must have been drunk while writing this. This stuff: max_nlevels = np.inf
for i, n in enumerate(shape):
max_nlevels = min(max_nlevels, pywt.dwt_max_level(n, wavelet.dec_len)) has both an unused variable max_nlevels = min(pywt.dwt_max_level(n, wavelet.dec_len) for n in shape) Anyway, fixed that and removed some redundancy in other places. Merge after CI. |
d8ea024
to
8249a07
Compare
No description provided.