-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Taking transpose deprecation messages seriously #25491
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
Conversation
Here's a shot at simplifying the transpose deprecation message.
Thanks Matt! :) Though I agree this deprecation message should be tightened up, about this revision I share the misgivings expressed in #25463 (comment). Specifically, this revision does not provide enough information to facilitate functionally equivalent rewrites in most cases. Perhaps something similar to the iteration below, which provides that information while remaining comparably brief, would do the trick? Best!
|
I think we have different philosophies. I don't think we need to worry ourselves about giving folks the exact transformation to choose which replacement to use. I'd rather just give them precise information about how to choose. The longer this message gets, the less likely it all gets read. My proposal in this PR is already verging on too long for my tastes. |
I would say that I agree with the last sentence, but it seems we are nonetheless not on the same page, so let's iterate :). As a user upgrading my code to a new release, I want each deprecation warning to tell me clearly and unambiguously what to write to make my code work precisely as it did before. I do not want to guess at or have to experiment with rewrites, nor do I want the rewrite to change the meaning of my code insofar as possible. I want to upgrade with minimal time, effort, and frustration, and move on with whatever I am trying to accomplish. From that perspective, the proposed message leaves something to be desired. Specifically,
would often lead me astray where the result is an intermediate computation but does not appear directly in a Hence my expansion of the quoted sentence above to
to achieve
The suggestion I gave above could be pared down a bit further, e.g. to
though beyond that I see little room for further reduction without leading users astray / into frustration. Thoughts? Best! |
Ah, yes, I see your point. And I imagine that folks will generally identify the more general lazy/copy issue themselves according to their own comfort and expertise. How's this for a final message?
|
Looks great! Much thanks for your efforts Matt! :) and |
💯 this deprecation message is ridiculous. I would never read it. Sorry, @Sacha0! |
No worries! :) As above I agree, and happily it seems we've converged on a much improved depwarn. This pull request should be mergeworthy after updating its text to #25491 (comment) I think, @mbauman? Best! |
I just pushed the version @Sacha0 and I converged on. Still a bit long, but a big improvement.
|
Would it be possible to add some line breaks so that it prints more like
? |
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 great! :)
It seems much clearer to me to write:
The differentiation between the vector and matrix cases in the deprecation message, while I understand the motivation, is just confusing to me. |
Yes, that's similar to my initial version, too. I think Sacha has a point, though: I think the message that details the exact transformation is better for novice users. |
I think the logging should do that automatically at some point. |
It’s precisely novice users who will think that the rules as stated, with all sorts of special cases, are insanely complicated. Most users don’t need the exact transformation. They don’t need their code to be exactly equivalent to 0.6 in terms of making copies. They just want to know how to transpose something. |
Absolutely true. But that's not the only consideration. We're not nearly close to the point where the transpose wrappers perform similarly to the original structures. Very trivial example:
|
Here's a shot at simplifying the transpose deprecation message. cc @Sacha0.