camelot-dev / camelot-dev/camelot

Decimal Points Missed Entirely by New Version

Open
#290 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
3.8k
Forks
546
Avg merge
3d 17h
Merged PRs (30d)
3

Description

**Describe the bug**

Decimal points are sometimes not read by the program despite being in the pdf text. I.e., it reads "1.5" as "15". The is a **new** bug, as version 0.7.2 was working correctly. The current version (0.10.1) as well as 0.7.3 both fail.

**Steps to reproduce the bug**

1. Download this [table](https://www.osce.org/files/f/documents/6/2/369741.pdf).
2. Install camelot: `pip install camelot-py==0.10.1`
3. Run

`camelot -p all -o "test-NEW.csv" -f csv -split -strip ".\n" lattice -scale 100 -copy v "369746.pdf"`

4. Install older version: `pip install camelot-py==0.7.2`
5. Run

`camelot -p all -o "test-OLD.csv" -f csv -split -strip ".\n" lattice -scale 100 -copy v "369746.pdf"`

7. Open test-NEW-page-1-table-1.csv and test-OLD-page-1-table-1.csv.

**Expected behavior**

Line 2 of test-OLD.csv is what we **should** have:

"SMM camera at Donetsk Filtration Station (15km N of Donetsk)","**0.5-1.5km**","S","Recorded","2","Projectile","From E to W","N/K","31-Jan","19:35"

Line 2 of test-NEW.csv is **misread**:
"SMM camera at Donetsk Filtration Station (15km N of Donetsk)","**05-15km**","S","Recorded","1","Projectile","From E to W","N/K","31-Jan","19:34"

(Note that the same thing happens to the column name located in the first row -- "No." is converted into "No".)

**PDF**

[PDF](https://www.osce.org/files/f/documents/6/2/369741.pdf)

**Environment**

- OS: Garuda Linux (Arch-based)
- Python version: 3.10.2
- Numpy version: 1.22.2-1
- OpenCV version: 4.5.5-3
- Ghostscript version: 9.55.0-4
- Camelot version: 0.10.1

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the listed camelot CLI command against the linked PDF and compare test-NEW-page-1-table-1.csv with the older output from version 0.7.2. Trace the camelot command entry point and PDF table-extraction path; done means decimal points and the period in "No." are preserved in the generated CSV, matching the expected older output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.