Skip to content
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

Merged
merged 3 commits into from Feb 13, 2017

Conversation

adler-j
Copy link
Member

@adler-j adler-j commented Feb 6, 2017

No description provided.

>>> pywt_max_nlevels([10, 1024], 'haar')
3
"""

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line, remove

Copy link
Member

@kohr-h kohr-h left a 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


Parameters
----------
shape : sequence
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sequence of ints

@@ -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.
Copy link
Member

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?

Copy link
Member Author

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?

@adler-j
Copy link
Member Author

adler-j commented Feb 13, 2017

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 i, and is basically a complicated way of writing

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.

@adler-j adler-j force-pushed the issue-866__default_wavelet_nlevels branch from d8ea024 to 8249a07 Compare February 13, 2017 09:05
@adler-j adler-j merged commit e2e970c into odlgroup:master Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants