Skip to content
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

f-string formatting #3277

Merged
merged 6 commits into from Nov 17, 2021
Merged

Conversation

Mehdi2402
Copy link
Contributor

@Mehdi2402 Mehdi2402 commented Nov 15, 2021

Fix #3257

Replaced .format() and % by f-strings in the following modules :

  • tests
  • metrics
  • benchmarks
  • utils
  • templates
  • src/Datasets/*.py

Modules in src/Datasets/:

  • commands
  • features
  • formatting
  • io
  • tasks
  • utils

Module datasets will not be edited as asked by @mariosasko

-A correction of the first PR (#3267)-

@Mehdi2402
Copy link
Contributor Author

Hello @lhoestq, make style is applied as asked. :)

Copy link
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for all the changes ! It makes everything consistent and easier to read :)

I think I just spotted one issue:

tests/test_dataset_dict.py Outdated Show resolved Hide resolved
Copy link
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright it's all good now, thanks :)

Merging !

@lhoestq lhoestq merged commit 3edbeb0 into huggingface:master Nov 17, 2021
Copy link
Contributor

@Carlosbogo Carlosbogo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At line 30 in benchmarks/format.py, shouldn't the new f-string also reference old_val instead of new_val?

@Mehdi2402 Mehdi2402 deleted the f-string-formatting-2 branch November 19, 2021 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use f-strings for string formatting
3 participants