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

provide a more helpful error message for wrong wavelet type #337

Merged
merged 2 commits into from
Dec 3, 2017

Conversation

grlee77
Copy link
Contributor

@grlee77 grlee77 commented Nov 28, 2017

In current master, providing the name of a continuous wavelet to a discrete transform such as wavedecn results in the non-obvious AttributeError shown in #333

This PR provides a helpful error message when discrete transforms are called with either a
ContinuousWavelet object or a name corresponding to a ContinuousWavelet. In all cases, the error message is provided either directly via _as_wavelet (or indirectly via _wavelets_per_axis).

New tests verify that a ValueError rather than AttributeError is raised for each of the discrete transforms.

closes #333

…ovided

This PR will cause all discrete transforms to provide a helpful error message if they are called with a ContinousWavelet
object or a name corresponding to a ContinuousWavelet.
@codecov-io
Copy link

Codecov Report

Merging #337 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #337      +/-   ##
==========================================
+ Coverage   86.22%   86.29%   +0.07%     
==========================================
  Files          21       21              
  Lines        3099     3094       -5     
  Branches      562      556       -6     
==========================================
- Hits         2672     2670       -2     
+ Misses        374      373       -1     
+ Partials       53       51       -2
Impacted Files Coverage Δ
pywt/_multilevel.py 92.57% <100%> (-0.03%) ⬇️
pywt/_utils.py 94.44% <100%> (+6.2%) ⬆️
pywt/_dwt.py 98.95% <100%> (+0.95%) ⬆️
pywt/_swt.py 96.84% <100%> (-0.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02b3fc6...001f7c2. Read the comment docs.

@rgommers rgommers added this to the v1.0 milestone Dec 3, 2017
@rgommers
Copy link
Member

rgommers commented Dec 3, 2017

LGTM, thanks @grlee77

@rgommers rgommers merged commit d6e6256 into PyWavelets:master Dec 3, 2017
@grlee77 grlee77 deleted the discr_vs_cont branch July 20, 2018 21:29
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.

user-friendly error messages regarding discrete vs. continuous wavelets in transform routines
3 participants