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

Sync with fork #514

Merged
merged 556 commits into from
Dec 26, 2024
Merged

Sync with fork #514

merged 556 commits into from
Dec 26, 2024

Conversation

vinayak-mehta
Copy link
Member

No description provided.

Smitha and others added 30 commits October 14, 2024 21:34
Bumps [mypy](https://github.com/python/mypy) from 1.11.2 to 1.12.0.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](python/mypy@v1.11.2...v1.12.0)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Fixes N806 variable 'SCORE_VAL' in function should be lowercase
Bumps [setuptools](https://github.com/pypa/setuptools) from 75.1.0 to 75.2.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](pypa/setuptools@v75.1.0...v75.2.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Improve python compatability
1. **Modular Functions**: The code is broken down into smaller functions (`_process_horizontal_cut`, `_process_vertical_cut`, and `_group_and_process_chars`) to handle specific tasks, making it easier to read and maintain.
2. **Error Handling**: The try-except block was removed since the logic handles cases gracefully without needing to catch exceptions.
3. **Type Hints**: Type hints were added for better code clarity and to help with type checking.
1. **Removed Unnecessary Checks**: The code now handles edge cases (when `point` is less than the first element or greater than the last element) upfront to simplify the binary search logic.

2. **Simplified Logic**: The binary search loop has been streamlined. The conditions for moving `left` and `right` have been clarified, focusing on the mid-point comparison without extra checks.

3. **Post-Loop Calculation**: After the binary search loop, we directly check the closest points by comparing the distances of the found indices to the `point`. This reduces redundancy and improves clarity.

4. **Type Annotations**: The docstring is improved to specify the types of parameters and return values, which enhances the understanding of this function.

Overall, this refactored function maintains the original functionality while being more efficient and easier to understand.
dependabot bot added 3 commits December 23, 2024 08:43
Bumps [charset-normalizer](https://github.com/jawah/charset_normalizer) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/jawah/charset_normalizer/releases)
- [Changelog](https://github.com/jawah/charset_normalizer/blob/master/CHANGELOG.md)
- [Commits](jawah/charset_normalizer@3.4.0...3.4.1)

---
updated-dependencies:
- dependency-name: charset-normalizer
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
@vinayak-mehta vinayak-mehta mentioned this pull request Dec 25, 2024
@vinayak-mehta
Copy link
Member Author

vinayak-mehta commented Dec 26, 2024

Need to cherry pick non dependabot commits so gonna create a new PR again

EDIT: it's hard to cherry pick only human commits so I'll keep dependabot commits for now

@vinayak-mehta vinayak-mehta deleted the py-pdf-main branch December 26, 2024 20:17
@vinayak-mehta vinayak-mehta restored the py-pdf-main branch December 26, 2024 20:45
@vinayak-mehta vinayak-mehta reopened this Dec 26, 2024
@vinayak-mehta vinayak-mehta merged commit b25b33f into master Dec 26, 2024
14 checks passed
@vinayak-mehta vinayak-mehta deleted the py-pdf-main branch December 26, 2024 22:28
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.

7 participants