-
Notifications
You must be signed in to change notification settings - Fork 138
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
MAINT deprecate average
in Scattering1D
#897
Conversation
Why not using
|
good idea but you cannot write |
Indeed. |
OK the |
@cyrusvahidi can't we default the issue raised by @janden was different:
or maybe i'm misunderstanding something? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one set of changes
this seems safe to me and also a better way to send the deprecate message. as long as we check |
it's certainly safe now but i'd argue it's too safe in the sense that (if i understand well " T=0 is only accepted if average=False") the average argument will remain compulsory (=False) if one wants to disable averaging. Just passing |
yes, too safe. So only error if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lostanlen what do ya think?
"average=False will override any T" is still not right. Here's what i have in mind, presented as a truth table
We have four possible combinations as of v0.2. With this PR, we will have nine, of which three are errors and three are deprecated. I haven't included this in the truth table, but cases This is a good first step towards supporting |
else: | ||
self.average = True if self.average is None else self.average | ||
if not self.average: | ||
raise ValueError("T must be None or 0 when average=False" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not sure what we're doing here. we're in a T>=1
branch, so the logic i'm hoping to see is:
if average==None
--> no lizard
if average==True
--> DeprecationWarning. Tell the user to remove average
kwarg, and that averaging will be applied.
if average==False
--> ValueError
. Tell the user to remove average
kwarg to apply averaging at scale T. Tell the user to set T=0
to disable averaging.
This ValueError
seems to suggest that T
should be modified and average
should be kept. That code will break in v0.4 since we'll remove the average
kwarg. So right now, we want to discourage the use of average
in all situations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this case if average
is None then indeed no lizard. if False
then there's a value error. I updated the message too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks perfect now !!
author: Cyrus Vahidi reviewers : Muawiz Chaudhary, Vincent Lostanlen * scat1d frontend: add deprecated average property * deprecate average documentation * new semantics for T and remove average kwargs * average default None kwargs * fix test Ux * fix scattering1d Ux tests * reinstate 1d average attribute * check T is integer * update deprecation warning msg * default average to None * deprecation message: * remove empty line * raise value error if average is False and T is not None or 0 * change valueerror message when average=False and T>=1 * update deprecation warning message * update deprecation warning message * update deprecation warning message * update value error message
Addressing #885. Deprecation of
Scattering1D
average
for v0.3, in preparation for removal in v0.4Alters the semantics of
T
:T=None
performs default mode averaging, i.e.T=2**J
T=0
is no averagingT
will stride over the specified supportI have made an
average
property and renamed the attribute toself._average
UPDATE: 25/06/22
average
kwarg and attribute.T=0
iffaverage=False
, else throws exception