Repository navigation
MAINT: Convert remaining percent-format strings to f-strings - #13974
Conversation
Convert the operator-style ``"..." % (...)`` string formatting that ruff's
UP031 rule does not detect into f-strings (in source_estimate, dipole,
_ola, mxne_optim and _source_space). Output is unchanged; format specs
such as ``%6.1f`` are preserved as ``{...:6.1f}``. Part of mne-tools#12360.
|
Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴 |
|
I think when looking at #13530 (comment) we decided that best practice was to get rid of |
My read of that thread is that |
|
Thanks both for the feedback! Happy to go with f-strings here, Let me know if you'd rather I switch the logger calls to lazy %-args instead I can update quickly |
|
🎉 Congrats on merging your first pull request! 🥳 Looking forward to seeing more from you in the future! 💪 |
|
Thanks @theosorus ! |
Reference issue (if any)
Closes #12360
converts the percent-format strings that ruff's UP031 rule does not detect.
What does this implement/fix?
Converts the remaining operator-style
"..." % (...)string formatting to f-strings insource_estimate.py,dipole.py,_ola.py,mxne_optim.pyand_source_space.py.Output is unchanged: format specs like
%6.1fbecome{...:6.1f}. Also cleans up onemixed f-string +
%formatting in_ola.py. The tabular%-format specs inchpi.py(printf-style over numeric arrays) are intentionally kept.
Additional information
AI assistance: I used an AI assistant to help locate the remaining percent-format strings
and draft the conversions; I reviewed and verified each change myself.