Skip to content

handle mixed dtype cofficients correctly across inverse transforms#450

Merged
rgommers merged 7 commits intoPyWavelets:masterfrom
grlee77:dtype_check_fix
Feb 4, 2019
Merged

handle mixed dtype cofficients correctly across inverse transforms#450
rgommers merged 7 commits intoPyWavelets:masterfrom
grlee77:dtype_check_fix

Conversation

@grlee77
Copy link
Copy Markdown
Contributor

@grlee77 grlee77 commented Jan 31, 2019

idwt allows mixed precision approximation and detail coefficients in its input, promoting to double precision in the case of mixed single and double precision coefficients. This PR extends this behaviour to other inverse transforms.

The lack of support for this in iswt was reported in #449, but a similar problem exists for other functions as well.

commit 8fc0e70 in this PR fixes a separate bug in the dtype up-casting in idwt when C99 support is enabled and mixed precision complex-valued arrays are provided (in this case, upcasting should be to complex128 not float64).

New tests for the desired behaviour have been added.

closes #449

@rgommers
Copy link
Copy Markdown
Member

rgommers commented Feb 1, 2019

LGTM. There's some code repetition, but not enough to pull this out into separate routines probably. Related: I noticed the _have_c99_complex logic that's similar - now that NumPy starts to require C99 (as of 1.17.0), we should start doing the same here probably to simplify the logic (low prio though).

@rgommers rgommers added this to the v1.1 milestone Feb 4, 2019
@rgommers
Copy link
Copy Markdown
Member

rgommers commented Feb 4, 2019

Had another look through this, all looks fine so merging. Thanks @grlee77

@rgommers rgommers merged commit e404a1e into PyWavelets:master Feb 4, 2019
@grlee77 grlee77 deleted the dtype_check_fix branch November 13, 2019 00:50
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.

Coefficients arrays must have the same dtype error in iswt function

2 participants