-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
improved the string formatting syntax #4287
Conversation
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.
@sayantan1410 Thanks for your contribution!
Please update this line as well
LightGBM/tests/c_api_test/test_.py
Line 32 in adf36d7
raise Exception('Cannot find lightgbm library file in following paths:\n' + '\n'.join(dll_path)) |
in a similar manner (
'\n'
cannot be used inside f-strings)LightGBM/helpers/parameter_generator.py
Lines 222 to 223 in adf36d7
aliases_joined = '``, ``'.join([x.strip() for x in aliases[0].split(',')]) | |
aliases_str = f', aliases: ``{aliases_joined}``' |
Thanks for the help @sayantan1410 ! Please note I've added the following to the description of this pull request:
Mentioning any prior discussions about a change helps us, as reviewers, to more quickly understand what your pull request is trying to accomplish. It also helps us to trace back through the project's history and find related discussions. |
Okay thank you so much. @jameslamb |
Sorry for the inconvenience, but we recently merged a fix for some CI issues (#4288 ). Whenever you have time, could you please update this branch to the latest |
I will surely do that, there is absolutely no problem @jameslamb |
Hey, I have updated my branch with the master branch. Let me know if I have done everything correctly or something is needed to be changed or updated. @jameslamb |
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.
@sayantan1410 Thanks for adding line 32 into this PR. Please take a look at my new comments below.
Also, looks like there was a merging conflict - this PR shouldn't contain any files other than tests/c_api_test/test_.py
. Could you please fix this conflict?
tests/c_api_test/test_.py
Outdated
dll_path_joined = '\n\n'.join(dll_path) | ||
raise Exception(f'Cannot find lightgbm library file in following paths: {dll_path_joined}') |
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.
The first \n
was to separate the first sentence from the list of paths and items inside the list were combined with only one \n
not two.
dll_path_joined = '\n\n'.join(dll_path) | |
raise Exception(f'Cannot find lightgbm library file in following paths: {dll_path_joined}') | |
dll_path_joined = '\n'.join(dll_path) | |
raise Exception(f'Cannot find lightgbm library file in following paths:\n{dll_path_joined}') |
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.
Okay i will update the '/n' part and should I take back the commits that committed other files and make a fresh commit ? probably that is the way to do it. @StrikerRUS
tests/c_api_test/test_.py
Outdated
@@ -234,7 +235,7 @@ def test_booster(): | |||
ctypes.byref(out_len), | |||
result.ctypes.data_as(ctypes.POINTER(ctypes.c_double))) | |||
if i % 10 == 0: | |||
print('%d iteration test AUC %f' % (i, result[0])) | |||
print(f'{i} interation test AUC {result[0]:.6f}') |
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.
print(f'{i} interation test AUC {result[0]:.6f}') | |
print(f'{i} iteration test AUC {result[0]:.6f}') |
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.
I am so ashamed of this kind of errors, really sorry, will surely fix it. @StrikerRUS
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.
Oh, please don't be ashamed! We appreciate your help!
Hey, Because of some issue there was lots of errors in the check that's why I deleted all the commits but that for some reason closed the pull request, I didn't know that this happens, I am really sorry, Can I open a new pull request, I have everything figured out for the issue. Sorry for the inconvenience, I am ashamed I did this but it will be great if I solve the issue from another pull request. Actually I am new to open source contribution that is why I messed it up. @jameslamb |
Yes, please open a new pull request and we'd be happy to review it. No worries! |
Thank you so much !!! |
This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
I have changed the format of the strings in the print statement from old percentage version to the new format.
Contributes to #4136