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

DEP: Remove paeth_predictor #2773

Merged
merged 2 commits into from
Aug 5, 2024
Merged

DEP: Remove paeth_predictor #2773

merged 2 commits into from
Aug 5, 2024

Conversation

j-t-1
Copy link
Contributor

@j-t-1 j-t-1 commented Jul 24, 2024

No description provided.

Copy link

codecov bot commented Jul 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.11%. Comparing base (1d9d3bc) to head (413f3d0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2773      +/-   ##
==========================================
- Coverage   95.12%   95.11%   -0.01%     
==========================================
  Files          51       51              
  Lines        8555     8545      -10     
  Branches     1706     1704       -2     
==========================================
- Hits         8138     8128      -10     
  Misses        263      263              
  Partials      154      154              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stefan6419846
Copy link
Collaborator

IMHO this just reduces readability instead of really simplifying it.

@j-t-1
Copy link
Contributor Author

j-t-1 commented Jul 24, 2024

Maybe there is another way to refactor to avoid the if statement, as this is just a map reduce.

@j-t-1
Copy link
Contributor Author

j-t-1 commented Jul 25, 2024

paeth_predictor is only used to test itself; it is not used elsewhere. The functionality of this function is at line 221 of filters.py.

  1. We remove paeth_predictor.
  2. We use paeth_predictor in filters.py.

Thoughts?

@stefan6419846
Copy link
Collaborator

There apparently have been plans by @MartinThoma to deprecate and finally drop this method in #2068 (comment), but for now this apparently did not have any real priority.

@j-t-1
Copy link
Contributor Author

j-t-1 commented Jul 25, 2024

Thanks @stefan6419846.

What about moving paeth_predictor to filters.py (it is only used in this file) and calling it within _decode_png_prediction.

@stefan6419846
Copy link
Collaborator

Where is it used in filters.py? As far as I have seen, it is used nowhere and thus most likely can be removed. (As it is not part of a public module, we could even avoid the deprecation.)

@j-t-1
Copy link
Contributor Author

j-t-1 commented Jul 25, 2024

The body of paeth_predictor is on line 221.

This function is unused.
@stefan6419846
Copy link
Collaborator

I have to admit that I did not look for code copies, thus my search would not see this. Therefore just keeping it does not make much sense either.

@j-t-1 j-t-1 changed the title STY: Simplify paeth_predictor DEP: Remove paeth_predictor Jul 26, 2024
@pubpub-zz
Copy link
Collaborator

I agree to remove it.

@stefan6419846 stefan6419846 merged commit 38f3925 into py-pdf:main Aug 5, 2024
17 checks passed
@j-t-1 j-t-1 deleted the paeth branch August 5, 2024 12:24
@pubpub-zz pubpub-zz mentioned this pull request Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants