Skip to content

Rename Program to Parsed, shorten tokens_in_range#11627

Merged
dhruvmanila merged 1 commit intodhruv/parser-phase-2from
dhruv/parsed-rename
May 31, 2024
Merged

Rename Program to Parsed, shorten tokens_in_range#11627
dhruvmanila merged 1 commit intodhruv/parser-phase-2from
dhruv/parsed-rename

Conversation

@dhruvmanila
Copy link
Member

Summary

This PR renames Program to Parsed and shortens the tokens_in_range to in_range.

The Program terminology is used in red_knot and this rename is to avoid the conflict. The tokens_in_range is usually used as tokens.tokens_in_range which suggests that the "tokens" word is repeated, so let's shorten it.

@dhruvmanila dhruvmanila added the internal An internal refactor or improvement label May 31, 2024
@dhruvmanila dhruvmanila merged commit 0bf5252 into dhruv/parser-phase-2 May 31, 2024
@dhruvmanila dhruvmanila deleted the dhruv/parsed-rename branch May 31, 2024 04:49
@codspeed-hq
Copy link

codspeed-hq bot commented May 31, 2024

CodSpeed Performance Report

Merging #11627 will improve performances by 28.24%

Comparing dhruv/parsed-rename (d6a2035) with main (685d11a)

Summary

⚡ 19 improvements
✅ 11 untouched benchmarks

Benchmarks breakdown

Benchmark main dhruv/parsed-rename Change
lexer[large/dataset.py] 1.4 ms 1.1 ms +27.64%
lexer[numpy/ctypeslib.py] 284.3 µs 225.8 µs +25.93%
lexer[numpy/globals.py] 36.7 µs 29.6 µs +24.09%
lexer[pydantic/types.py] 639.9 µs 502.9 µs +27.23%
lexer[unicode/pypinyin.py] 98.3 µs 76.6 µs +28.24%
linter/all-rules[large/dataset.py] 16.9 ms 15.9 ms +6.5%
linter/all-rules[numpy/ctypeslib.py] 4.1 ms 3.9 ms +5.07%
linter/all-rules[pydantic/types.py] 8.2 ms 7.7 ms +6.91%
linter/default-rules[large/dataset.py] 4.3 ms 3.7 ms +16.42%
linter/default-rules[numpy/ctypeslib.py] 1,013.7 µs 941.2 µs +7.71%
linter/default-rules[pydantic/types.py] 2.1 ms 1.9 ms +11.87%
linter/default-rules[unicode/pypinyin.py] 406 µs 359.7 µs +12.86%
linter/all-with-preview-rules[large/dataset.py] 20.3 ms 19.2 ms +5.69%
linter/all-with-preview-rules[unicode/pypinyin.py] 2.4 ms 2.3 ms +4.37%
parser[large/dataset.py] 5.7 ms 5.2 ms +10.14%
parser[numpy/ctypeslib.py] 1,161.7 µs 991.4 µs +17.17%
parser[numpy/globals.py] 122.2 µs 105.8 µs +15.47%
parser[pydantic/types.py] 2.3 ms 2.2 ms +6.18%
parser[unicode/pypinyin.py] 371.3 µs 335.4 µs +10.68%

dhruvmanila added a commit that referenced this pull request May 31, 2024
## Summary

This PR renames `Program` to `Parsed` and shortens the `tokens_in_range`
to `in_range`.

The `Program` terminology is used in `red_knot` and this rename is to
avoid the conflict. The `tokens_in_range` is usually used as
`tokens.tokens_in_range` which suggests that the "tokens" word is
repeated, so let's shorten it.
dhruvmanila added a commit that referenced this pull request Jun 3, 2024
## Summary

This PR renames `Program` to `Parsed` and shortens the `tokens_in_range`
to `in_range`.

The `Program` terminology is used in `red_knot` and this rename is to
avoid the conflict. The `tokens_in_range` is usually used as
`tokens.tokens_in_range` which suggests that the "tokens" word is
repeated, so let's shorten it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant