Skip to content

Commit

Permalink
MAINT: fix check related to maximum scaling levels.
Browse files Browse the repository at this point in the history
  • Loading branch information
niinimaki committed Dec 18, 2015
1 parent 56ea203 commit 62c7353
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions odl/trafos/wavelet.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def coeff_size_list(shape, nscales, wbasis, mode):
''.format(len(shape)))

max_level = pywt.dwt_max_level(shape[0], filter_len=wbasis.dec_len)
if nscales >= max_level:
if nscales > max_level:
raise ValueError('Too many scaling levels, got {}, maximum useful'
' level is {}'
''.format(nscales, max_level))
Expand Down Expand Up @@ -603,9 +603,9 @@ def __init__(self, dom, nscales, wbasis, mode):
filter_len=self.wbasis.dec_len)
# TODO: maybe the error message could tell how to calculate the
# max number of levels
if self.nscales >= max_level:
if self.nscales > max_level:
raise ValueError('Cannot use more than {} scaling levels, '
'got {}.'.format(max_level - 1, self.nscales))
'got {}.'.format(max_level, self.nscales))

self.size_list = coeff_size_list(dom.grid.shape, self.nscales,
self.wbasis, self.mode)
Expand Down Expand Up @@ -767,7 +767,7 @@ def __init__(self, ran, nscales, wbasis, mode):
filter_len=self.wbasis.dec_len)
# TODO: maybe the error message could tell how to calculate the
# max number of levels
if self.nscales >= max_level:
if self.nscales > max_level:
raise ValueError('Cannot use more than {} scaling levels, '
'got {}.'.format(max_level, self.nscales))

Expand Down

0 comments on commit 62c7353

Please sign in to comment.