Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Conversation

@tomprogrammer
Copy link

I'm opening the merge request here too, as this repo is the active fork.

From all close points stored in i, j or k only the first one was used therefore the new function find_close_point only returns the first match if any.

Similar code is hoisted out of loops and branches and the while loops are more clearly expressed with for loops.

From all close points stored in `i`, `j` or `k` only the first one was used therefore the new function `find_close_point` only returns the first match if any. Similar code is hoisted out of loops and branches and the `while` loops are more clearly expressed with `for` loops.
Copy link
Collaborator

@bosd bosd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are 🟢 so, LGTM

@bosd bosd added refactoring Refactoring style Style labels Aug 26, 2024
@bosd bosd mentioned this pull request Aug 28, 2024
25 tasks
@bosd
Copy link
Collaborator

bosd commented Sep 6, 2024

Thanks for this PR.
Could you please incorporate the replacement of the numpy is close with the math.isclose?
Just like in #94

tomprogrammer and others added 2 commits September 7, 2024 10:36
`math.isclose()` is much faster than `np.isclose()` when comparing numbers. ``` >>> import timeit >>> print(timeit.timeit('np.isclose(0.5, 0, atol=1e-4)', 'import numpy as np', number=10000)) 0.06490494299941929 >>> print(timeit.timeit('math.isclose(0.5, 0, abs_tol=1e-4)', 'import math', number=10000)) 0.0034116959996026708 ```
@bosd bosd merged commit 2ea8c9b into py-pdf:main Oct 6, 2024
12 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

refactoring Refactoring style Style

2 participants