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? |
MuawizChaudhary
left a comment
There was a problem hiding this comment.
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 |
MuawizChaudhary
left a comment
There was a problem hiding this comment.
@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.
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.
in this case if average is None then indeed no lizard. if False then there's a value error. I updated the message too.
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
Scattering1Daveragefor v0.3, in preparation for removal in v0.4Alters the semantics of
T:T=Noneperforms default mode averaging, i.e.T=2**JT=0is no averagingTwill stride over the specified supportI have made an
averageproperty and renamed the attribute toself._averageUPDATE: 25/06/22
averagekwarg and attribute.T=0iffaverage=False, else throws exception