You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MNT]: Decide on a standard abbreviation for transforms when used as local variables #22156
For local variables, I tend to like trf, but @timhoffm prefers trans (#21965 (comment)). Does anyone have an opinion as to whether we should standardize on one of them?
Hey guys! So, to understand it better, inside the code, there are lots of local variables that refer to transforms. There is not a pattern on how to reference this transform in the variable name. So, to solve this, one would have to dig into the code and standardize everything. Is that right?
With that being said, I prefer trans :)
So, to solve this, one would have to dig into the code and standardize everything. Is that right?
Basically - the idea is that then if you search the code for the variable you'll hopefully find basically all the places in the code where a transform object is created/modified/etc.
I read trf as tee-are-eff and it makes me go double-u-tee-eff is that? 😅
trans is OK, and consistent with transData and transAxes, though really is transform so long? At the same time, in most places, we could even shorten it to just t or tf or trf, if necessary, as a prefix or a suffix, since the word transform is either there to get the thing when it is being assigned, or is the method called on the thing when it is being used. And yet another option would be to not assign to a variable at all, since it is rarely used more than once.
Activity
jklymak commentedon Jan 8, 2022
Mildly prefer
trans. I'll also note that is what Agg appears to use.timhoffm commentedon Jan 8, 2022
How about
trafo?pedrompecanha commentedon Sep 21, 2023
Hey guys! So, to understand it better, inside the code, there are lots of local variables that refer to transforms. There is not a pattern on how to reference this transform in the variable name. So, to solve this, one would have to dig into the code and standardize everything. Is that right?
With that being said, I prefer trans :)
story645 commentedon Sep 21, 2023
Basically - the idea is that then if you search the code for the variable you'll hopefully find basically all the places in the code where a transform object is created/modified/etc.
Arikad0 commentedon Oct 18, 2023
So, the objective is change the offset_transform occurences to any abreviation decided here? about the decision, I prefer trans
story645 commentedon Oct 19, 2023
It's to change local internal variable names for transform objects to trans (or whichever abbreviation has consensus). For example:
to
ivanov commentedon Oct 19, 2023
I read
trfastee-are-effand it makes me godouble-u-tee-eff is that? 😅transis OK, and consistent withtransDataandtransAxes, though really istransformso long? At the same time, in most places, we could even shorten it to justtortfortrf, if necessary, as a prefix or a suffix, since the wordtransformis either there to get the thing when it is being assigned, or is the method called on the thing when it is being used. And yet another option would be to not assign to a variable at all, since it is rarely used more than once.Here's a reasonable example from the code of a Quiver method which currently reads like this:
What would you want to change this to?
some options
tacaswell commentedon Oct 26, 2023
The consensus on the call is that:
transbeing in local variable namestimhoffm commentedon Sep 15, 2025
Closing as completed. The convention is documented at https://matplotlib.org/devdocs/devel/coding_guide.html#variable-names