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

Proper f string formatting 5 #1

Draft
wants to merge 23 commits into
base: joined-string-part
Choose a base branch
from

Conversation

davidszotten
Copy link
Owner

Summary

WIP proper f-string formatting (formatting inside f-strings)

note that black doesn't (yet?) do this so adding this is likely to decrease the similarity index scores (see eg diffs in the existing snapshots)

Test Plan

snapshots

@github-actions
Copy link

github-actions bot commented Aug 25, 2023

PR Check Results

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.92      7.9±0.02ms     5.2 MB/sec    1.00      4.1±0.03ms    10.0 MB/sec
formatter/numpy/ctypeslib.py               2.04   1748.0±1.82µs     9.5 MB/sec    1.00    855.5±2.03µs    19.5 MB/sec
formatter/numpy/globals.py                 2.33    197.1±0.37µs    15.0 MB/sec    1.00     84.7±0.31µs    34.8 MB/sec
formatter/pydantic/types.py                2.26      3.8±0.01ms     6.7 MB/sec    1.00   1689.4±6.15µs    15.1 MB/sec
linter/all-rules/large/dataset.py          1.31     13.3±0.05ms     3.1 MB/sec    1.00     10.2±0.07ms     4.0 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.23      3.4±0.01ms     4.9 MB/sec    1.00      2.7±0.02ms     6.1 MB/sec
linter/all-rules/numpy/globals.py          1.12    431.1±0.30µs     6.8 MB/sec    1.00    384.6±1.36µs     7.7 MB/sec
linter/all-rules/pydantic/types.py         1.11      5.9±0.01ms     4.3 MB/sec    1.00      5.3±0.03ms     4.8 MB/sec
linter/default-rules/large/dataset.py      1.17      6.6±0.01ms     6.1 MB/sec    1.00      5.7±0.03ms     7.2 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.17   1458.3±1.53µs    11.4 MB/sec    1.00  1247.9±22.07µs    13.3 MB/sec
linter/default-rules/numpy/globals.py      1.16    166.5±0.23µs    17.7 MB/sec    1.00    143.9±3.27µs    20.5 MB/sec
linter/default-rules/pydantic/types.py     1.18      3.0±0.01ms     8.5 MB/sec    1.00      2.5±0.02ms    10.0 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.94      9.3±0.08ms     4.4 MB/sec    1.00      4.8±0.05ms     8.5 MB/sec
formatter/numpy/ctypeslib.py               2.06      2.0±0.03ms     8.2 MB/sec    1.00   985.0±14.34µs    16.9 MB/sec
formatter/numpy/globals.py                 2.37    230.0±3.66µs    12.8 MB/sec    1.00     97.1±2.66µs    30.4 MB/sec
formatter/pydantic/types.py                2.24      4.5±0.06ms     5.7 MB/sec    1.00  1990.0±33.00µs    12.8 MB/sec
linter/all-rules/large/dataset.py          1.25     15.7±0.17ms     2.6 MB/sec    1.00     12.5±0.11ms     3.2 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.21      4.2±0.06ms     4.0 MB/sec    1.00      3.4±0.04ms     4.8 MB/sec
linter/all-rules/numpy/globals.py          1.17   506.9±11.36µs     5.8 MB/sec    1.00    434.4±8.83µs     6.8 MB/sec
linter/all-rules/pydantic/types.py         1.07      7.0±0.08ms     3.6 MB/sec    1.00      6.6±0.10ms     3.9 MB/sec
linter/default-rules/large/dataset.py      1.15      8.1±0.07ms     5.0 MB/sec    1.00      7.1±0.05ms     5.7 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.15  1730.7±18.68µs     9.6 MB/sec    1.00  1506.7±18.26µs    11.1 MB/sec
linter/default-rules/numpy/globals.py      1.18    205.8±5.13µs    14.3 MB/sec    1.00    174.3±3.08µs    16.9 MB/sec
linter/default-rules/pydantic/types.py     1.15      3.6±0.03ms     7.0 MB/sec    1.00      3.2±0.03ms     8.1 MB/sec

@davidszotten davidszotten force-pushed the joined-string-part branch 3 times, most recently from 5907914 to d9fdd3d Compare September 24, 2023 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant