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.
|
Pierre-Sassoulas
left a comment
There was a problem hiding this comment.
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 .