Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
## 0.18.27-dev5

### Enhancement
- Upgrade pdfminer-six to 20260107 to fix ~15-18% performance regression from eager f-string evaluation

## 0.18.27-dev4
## 0.18.27-dev6

### Fixes
- Comment no-ops in `zoom_image` (codeflash)
Expand All @@ -13,6 +8,8 @@
- Optimize `_PartitionerLoader._load_partitioner` (codeflash)
- Optimize `detect_languages` (codeflash)
- Optimize `contains_verb` (codeflash)
- Optimize `get_bbox_thickness` (codeflash)
- Upgrade pdfminer-six to 20260107 to fix ~15-18% performance regression from eager f-string evaluation

## 0.18.26

Expand Down
2 changes: 1 addition & 1 deletion unstructured/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.18.27-dev5" # pragma: no cover
__version__ = "0.18.27-dev6" # pragma: no cover
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ def _get_optimal_value_for_bbox(
The optimal value for the given bounding box and parameters given.
"""
bbox_to_page_ratio = _get_bbox_to_page_ratio(bbox, page_size)
coefficients = np.polyfit((ratio_for_min_value, ratio_for_max_value), (min_value, max_value), 1)
value = int(bbox_to_page_ratio * coefficients[0] + coefficients[1])
# Direct linear interpolation instead of np.polyfit for better performance
slope = (max_value - min_value) / (ratio_for_max_value - ratio_for_min_value)
value = int(min_value + slope * (bbox_to_page_ratio - ratio_for_min_value))
return max(min_value, min(max_value, value))


Expand Down
Loading