Skip to content

STYLE enable ruff TCH #51740

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

Closed
MarcoGorelli opened this issue Mar 2, 2023 · 18 comments · Fixed by #51798 or #52159
Closed

STYLE enable ruff TCH #51740

MarcoGorelli opened this issue Mar 2, 2023 · 18 comments · Fixed by #51798 or #52159
Labels
Code Style Code style, linting, code_checks good first issue

Comments

@MarcoGorelli
Copy link
Member

MarcoGorelli commented Mar 2, 2023

This code actually may make a difference to performance:

Task here is:
0. make sure you've followed the steps in https://pandas.pydata.org/docs/dev/development/contributing.html and have set up your development environment

  1. remove 3-5 of the lines in

pandas/pyproject.toml

Lines 293 to 326 in d385465

# TCH to be enabled gradually
"pandas/core/arrays/*" = ["TCH"]
"pandas/core/io/*" = ["TCH"]
"pandas/core/indexers/*" = ["TCH"]
"pandas/core/indexes/*" = ["TCH"]
"pandas/core/internals/*" = ["TCH"]
"pandas/core/groupby/*" = ["TCH"]
"pandas/core/methods/*" = ["TCH"]
"pandas/core/array_algos/*" = ["TCH"]
"pandas/core/dtypes/*" = ["TCH"]
"pandas/core/generic.py" = ["TCH"]
"pandas/core/frame.py" = ["TCH"]
"pandas/core/series.py" = ["TCH"]
"pandas/core/resample.py" = ["TCH"]
"pandas/core/nanops.py" = ["TCH"]
"pandas/core/apply.py" = ["TCH"]
"pandas/core/base.py" = ["TCH"]
"pandas/core/algorithms.py" = ["TCH"]
"pandas/core/ops/*" = ["TCH"]
"pandas/core/sorting.py" = ["TCH"]
"pandas/core/construction.py" = ["TCH"]
"pandas/core/common.py" = ["TCH"]
"pandas/core/missing.py" = ["TCH"]
"pandas/core/util/*" = ["TCH"]
"pandas/core/reshape/*" = ["TCH"]
"pandas/core/strings/*" = ["TCH"]
"pandas/core/tools/*" = ["TCH"]
"pandas/core/window/*" = ["TCH"]
"pandas/io/*" = ["TCH"]
"pandas/tseries/*" = ["TCH"]
"pandas/tests/*" = ["TCH"]
"pandas/plotting/*" = ["TCH"]
"pandas/util/*" = ["TCH"]
"pandas/_libs/*" = ["TCH"]

  1. run pre-commit run ruff --all-files, and fix up the issues it reports. You can see STYLE start enabling TCH #51687 for some examples of how to do this
  2. if pre-commit run ruff --all-files passes, then stage, commit, push, open pull request, celebrate

Please don't comment "take" on this issue (as multiple people can be assigned), and don't ask for permission to work on it. Instead, just leave a comment letting people know which

@MarcoGorelli MarcoGorelli added Code Style Code style, linting, code_checks good first issue labels Mar 2, 2023
@t0uch9r455
Copy link

t0uch9r455 commented Mar 3, 2023

I am working on pandas/core/arrays

@potap75
Copy link
Contributor

potap75 commented Mar 3, 2023

Doing pandas/core/io/*

@potap75
Copy link
Contributor

potap75 commented Mar 3, 2023

I got this when trying to do a pull request:
Screenshot 2023-03-04 at 12 22 52 AM

@luke396
Copy link
Contributor

luke396 commented Mar 4, 2023

I am working on

"pandas/core/indexers/*" 
"pandas/core/indexes/*"
"pandas/core/internals/*" 
"pandas/core/groupby/*"
"pandas/core/methods/*"

@luke396
Copy link
Contributor

luke396 commented Mar 4, 2023

Continue to working on

"pandas/core/array_algos/*"
"pandas/core/dtypes/*"
"pandas/core/generic.py"
"pandas/core/frame.py"
"pandas/core/series.py"

@v-mcoutinho
Copy link
Contributor

v-mcoutinho commented Mar 5, 2023

I did "pandas/_libs/*"

@DerTimonius
Copy link
Contributor

I will try pandas/core/common.py!

@Rylie-W
Copy link
Contributor

Rylie-W commented Mar 5, 2023

Trying pandas/core/resample.py

@DerTimonius
Copy link
Contributor

I'll go for pandas/core/util/* next. Also @MarcoGorelli it looks like my PR closed this issue...

@luke396
Copy link
Contributor

luke396 commented Mar 7, 2023

Working on

"pandas/core/reshape/*"
"pandas/core/strings/*" 
"pandas/core/tools/*"
"pandas/core/window/*"
"pandas/io/*"

@ErdiTk
Copy link
Contributor

ErdiTk commented Mar 7, 2023

Working on:

 "pandas/core/apply.py" = ["TCH"] 
 "pandas/core/base.py" = ["TCH"] 
 "pandas/core/algorithms.py" = ["TCH"] 
 "pandas/core/ops/*" = ["TCH"] 
 "pandas/core/sorting.py" = ["TCH"] 

@luke396
Copy link
Contributor

luke396 commented Mar 8, 2023

Working on, and @MarcoGorelli , maybe need to reopen this issue again, when #51827 merged.

"pandas/core/construction.py" = ["TCH"] 
"pandas/core/missing.py" = ["TCH"] 
"pandas/tseries/*" = ["TCH"] 
"pandas/tests/*" = ["TCH"] 
"pandas/plotting/*" = ["TCH"] 

@Ramyahkay
Copy link

Working on : "pandas/core/nanops.py" = ["TCH"]

@ahmad-04
Copy link
Contributor

I am working on "pandas/util/*" = ["TCH"]

@ahmad-04
Copy link
Contributor

hey @Ramyahkay are you working on "pandas/core/nanops.py" = ["TCH"] ??

@Ramyahkay
Copy link

hey @Ramyahkay are you working on "pandas/core/nanops.py" = ["TCH"] ??

Yes, I am still working on it.

@MarcoGorelli
Copy link
Member Author

MarcoGorelli commented Mar 23, 2023

@ahmad2901 (or anyone else) - feel free to submit a PR and close off this issue, at this point I presume they're no longer working on it

@ahmad-04
Copy link
Contributor

Sure I will do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants