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

fix bug in iswtn for data of arbitrary shape when using user-specified axes #462

Merged
merged 2 commits into from
Feb 18, 2019

Conversation

grlee77
Copy link
Contributor

@grlee77 grlee77 commented Feb 14, 2019

closes #460

The issue was a variable that should have only contained the shape of the transformed axes and not all axes. This was missed by the current tests because these used the same size on each axis of the transformed array so it didn't matter if the shape from the wrong axis was selected.

A new test case with various permutations of shapes and non-transformed axis was added. Specifically the test case tests the following shape, axes permutations:

shape = (1, 48, 32), axes = [1, 2]
shape = (1, 32, 48), axes = [1, 2]
shape = (48, 1, 32), axes = [0, 2]
shape = (48, 32, 1), axes = [0, 1]
shape = (32, 1, 48), axes = [0, 2]
shape = (32, 48, 1), axes = [0, 1]

@grlee77 grlee77 added the bug label Feb 14, 2019
@grlee77
Copy link
Contributor Author

grlee77 commented Feb 18, 2019

i would like to also include this one in the next bug fix release if anyone can do a quick review

@rgommers rgommers merged commit 2e3a224 into PyWavelets:master Feb 18, 2019
@rgommers
Copy link
Member

LGTM, merged. Thanks @grlee77

@rgommers
Copy link
Member

that was a sloppy bug, makes me wonder if we should do odd shape testing in other functions

@rgommers rgommers added this to the v1.1 milestone Feb 18, 2019
@grlee77
Copy link
Contributor Author

grlee77 commented Feb 18, 2019

makes me wonder if we should do odd shape testing in other functions

I think it is already reasonably covered for wavedecn/waverecn. See for example:

def test_wavedecn_shapes_and_size():
wav = pywt.Wavelet('db2')
for data_shape in [(33, ), (64, 32), (1, 15, 30)]:
for axes in [None, 0, -1]:
for mode in pywt.Modes.modes:

and some other tests use odd size and/or a different size per axis.

@grlee77
Copy link
Contributor Author

grlee77 commented Feb 18, 2019

thanks for the quick review!

grlee77 added a commit that referenced this pull request Feb 18, 2019
@grlee77 grlee77 deleted the iswtn_axis_fix branch November 13, 2019 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iswtn error when using axes and excluded dim is desn't comply to the level
2 participants