-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Consolidate numpy member transforms to reduce function calls #2550
Consolidate numpy member transforms to reduce function calls #2550
Conversation
Codecov ReportAll modified and coverable lines are covered by tests β
Additional details and impacted files@@ Coverage Diff @@
## main #2550 +/- ##
==========================================
- Coverage 92.97% 92.94% -0.04%
==========================================
Files 93 93
Lines 11081 11086 +5
==========================================
+ Hits 10303 10304 +1
- Misses 778 782 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Is yt-dlp using numpy ? I wonder if some brains should be user activated. (Via an astroid-numpy or pylint-numpy plugin).
Also we might want to deprecate now or even remove now, I doubt those are APIs used by lots of person. Removing in 4.0 seems reasonable (waiting for another input on that, we might just remove now).
yt-dlp doesn't seem to use numpy. I was hesitant to remove the unused functions from I'm wondering if some of the API clean-ups needed for typing can happen "in place" like the changes in this PR. The code (and tests) would be messier in the short term, but it might make it easier to make progress without having to maintain multiple branches. The idea needs more investigation, though :). |
I'll discuss this on discord, but I'd like to advance the main branches of pylint and astroid to 4.0-dev later this month. |
@jacobtylerwalls I think this happened for |
Sure thing. I'll follow with a PR do the same in astroid so that @correctmost can resolve the todos by doing the removals. |
Type of Changes
Description
pylint-dev/pylint#9783 notes that numpy predicates are called millions of times when linting large codebases. I was able to reduce these calls by ~5.9 million when linting yt-dlp by consolidating the transforms.
Stats
I profiled yt-dlp @ ef36d517f9b0 with the import-error rule.
Before
pylint --recursive=y .
After
pylint --recursive=y .