Repository navigation
fix % in to f String - #12405
fix % in to f String#12405Aditya3425-Fst wants to merge 3 commits into
Conversation
|
Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴 |
|
Thanks for taking a stab! There are several things that should be addressed:
|
mscheltienne
left a comment
There was a problem hiding this comment.
Looking at the 2 first files, I'm spotting several typos in capital letters or spacing. Could you go through your proposed changes again and fix those first?
| # "Invalid parameter %s for estimator %s. " | ||
| f"Invalid parameter{name}for estimator{self}" |
There was a problem hiding this comment.
| # "Invalid parameter %s for estimator %s. " | |
| f"Invalid parameter{name}for estimator{self}" | |
| f"Invalid parameter {name} for estimator {self}. " |
| # " %s with constructor %s doesn't " | ||
| f"{cls} with constructor {init_signature} doesn't follow this convention." |
There was a problem hiding this comment.
| # " %s with constructor %s doesn't " | |
| f"{cls} with constructor {init_signature} doesn't follow this convention." | |
| f" {cls} with constructor {init_signature} doesn't follow this convention." |
There was a problem hiding this comment.
There's also 2 spaces after "doesn't"
There was a problem hiding this comment.
fixed in the suggested change.
| # warn("SVD error (%s), attempting to use GESVD instead of GESDD" % (exp,)) | ||
| warn(f"SVD error ({exp}), attempting to use GESVD instend of GESDD") |
There was a problem hiding this comment.
| # warn("SVD error (%s), attempting to use GESVD instead of GESDD" % (exp,)) | |
| warn(f"SVD error ({exp}), attempting to use GESVD instend of GESDD") | |
| warn(f"SVD error ({exp}), attempting to use GESVD instend of GESDD") |
| # "Invalid parameter %s for estimator %s. " | ||
| f"Invalid parameter {key}for estimator{self.__class__.__name__} for estimator" |
There was a problem hiding this comment.
| # "Invalid parameter %s for estimator %s. " | |
| f"Invalid parameter {key}for estimator{self.__class__.__name__} for estimator" | |
| f"Invalid parameter {key} for estimator {self.__class__.__name__}. " |
| # return "%s(%s)" % (class_name, self.__class__.__name__) | ||
| return f"{class_name}({self.__class__.__name__})" |
There was a problem hiding this comment.
| # return "%s(%s)" % (class_name, self.__class__.__name__) | |
| return f"{class_name}({self.__class__.__name__})" | |
| return f"{class_name}({params.read().strip()})" |
| # msg = "Coil too close (dist = %g mm)" % (min_dist * 1000,) | ||
| msg = f"coil too close (dist = {(min_dist * 1000,)}mm)" |
There was a problem hiding this comment.
This one does not remove the trailing zeroes as %g does.
#12360
Summary:
This pull request addresses the conversion of "%" symbols into f-strings for improved readability and maintainability.
Changes Made:
Replaced "%" formatting with f-strings for string interpolation.
Updated relevant code blocks to adhere to the Python 3.6 and later syntax.
Benefits:
Enhanced code clarity: f-strings provide a more concise and readable syntax for string formatting.
Improved maintainability: The use of f-strings aligns with modern Python practices, making the codebase more up-to-date.
Testing:
Ensured that the changes do not introduce any functional issues.
Conducted thorough testing to validate the correctness of the converted f-strings.
Additional Notes:
No changes to the logic or functionality of the code, only a syntactic enhancement.
Compatible with Python 3.6 and later versions.
Please review the changes, and feel free to provide feedback or ask for further clarification if needed.