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

DEV: Improve error reporting of read_object #1412

Merged
merged 5 commits into from Nov 1, 2022

Conversation

pubpub-zz
Copy link
Collaborator

@pubpub-zz pubpub-zz commented Oct 30, 2022

Additionally, use time.process_time instead of time.time for test_readStringFromStream_performance

@pubpub-zz pubpub-zz mentioned this pull request Oct 30, 2022
@pubpub-zz
Copy link
Collaborator Author

@MartinThoma
Don't kwow how to handle this timing issue... Any ideas ?

@pubpub-zz
Copy link
Collaborator Author

@MartinThoma Don't kwow how to handle this timing issue... Any ideas ?

@MartinThoma
I had to increase the test threshold successfully. Now, it is a (one shot?) issue to load test data...
Please make up your mind to merge or not this PR. I will wait for this one and #1411 to clean up #1371

@MartinThoma MartinThoma changed the title improve error reporting DEV: Improve error reporting of read_object Nov 1, 2022
@codecov
Copy link

codecov bot commented Nov 1, 2022

Codecov Report

Base: 94.19% // Head: 94.18% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (4926132) compared to base (613b370).
Patch coverage: 50.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1412      +/-   ##
==========================================
- Coverage   94.19%   94.18%   -0.02%     
==========================================
  Files          28       28              
  Lines        5085     5086       +1     
  Branches      968      968              
==========================================
  Hits         4790     4790              
- Misses        176      177       +1     
  Partials      119      119              
Impacted Files Coverage Δ
PyPDF2/generic/_data_structures.py 95.03% <0.00%> (-0.16%) ⬇️
PyPDF2/_page.py 92.16% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MartinThoma
Copy link
Member

Overall, this PR looks good and I'll merge it after CI succeeds.

Regarding the timing-test:

I think we should get rid of the time-checking unit tests (and never do that again). At least if the difference is not huge.
For example, it would be ok for me for places where quadratic growth was removed and we have at least a 100-fold time improvement.

In this case, the factor seems to be 5-10, and thus it's too brittle.

Benchmarks are a completely different story. This test might a good candidate to move to https://py-pdf.github.io/PyPDF2/dev/bench/

@MartinThoma MartinThoma merged commit d821723 into py-pdf:main Nov 1, 2022
@pubpub-zz pubpub-zz deleted the ErrorRep1 branch June 24, 2023 08:39
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.

None yet

2 participants