Remove parenthesis in getitem calls#4844
Conversation
5e4ef52 to
5f1d904
Compare
|
I also prefer that style but I recall that there wasn't a consensus last time it was discussed. |
|
I feel like once upon a time we did it this way, and then when we moved to mandating field tuples we changed it, and I don't think I particularly cared for the change then but I honestly don't know that I am that invested one way or the other now. It does feel like a lot of churn though. |
|
To be fair I'm also happy for this not to be merged. However, at present, we're using both styles in the codebase (depending on who wrote it), so for the sake of uniformity, it'd be marginally better to settle on either one of the formats ( |
|
@yt-fido test this please... |
|
+1 from me for removing parenthesis. also agree it'd be nice to merge ASAP if folks agree with the change. |
|
bandaids are meant to be ripped off, I suppose! |
|
And actually, how hard would it be to make a rule for ruff to apply this? Probably easy to write, hard to confine to just yt data objects, now that I'm thinking of it. |
|
I had the same idea but I'm too intimidated to try it out myself :D
I believe parentheses are never required anywhere that looks like |
Yeah, you must be right. I think I got confused because of the way h5py recommends |
|
Would you like to give it a go or is it okay if we just open a feature request on ruff ? |
|
Id say let's open an issue; I won't have time to implement this anytime soon. |
|
My question was meant for Matt, sorry for being unclear ! |
|
No conflict after two weeks and no objection in sight, so I'll push the button. Thanks all ! |
|
Btw I just opened a feature request on ruff astral-sh/ruff#11990 |
PR Summary
In accordance with the style of the code, replace all occurences of
data[("gas", "density")]withdata["gas", "density"](no extra parentheses).This is merely a stylistic change.