Skip to content

NPI-4066 Reject SP3 files with overlong data lines#91

Merged
treefern merged 1 commit intomainfrom
NPI-4066-reject-sp3-on-overlong-lines
Jul 1, 2025
Merged

NPI-4066 Reject SP3 files with overlong data lines#91
treefern merged 1 commit intomainfrom
NPI-4066-reject-sp3-on-overlong-lines

Conversation

@treefern
Copy link
Collaborator

SP3 data lines are fixed width and strictly follow a columnar layout. Misaligned data can lead to serious parsing issues, including grossly incorrect position values.

This PR adds a simple check to read_sp3(), rejecting any SP3 data which has line(s) exceeding 80 chars.

Further work is in train to more robustly check alignment by testing that all unused columns contain a space.

@treefern treefern requested a review from ronaldmaj June 30, 2025 11:35
@treefern treefern self-assigned this Jun 30, 2025
Copy link
Collaborator

@ronaldmaj ronaldmaj left a comment

Choose a reason for hiding this comment

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

This is a nice PR that quickly tests for lines are too long, which is usually indicative of Ginan processing gone awry. It'll enable our rapid and ultra-rapid jobs to fail quickly when there are issues.

I've tested this with a file that was problematic - it detected all lines that exceeded the line length successfully.

Happy for this to go in 👍

@treefern treefern merged commit 2133fb3 into main Jul 1, 2025
4 checks passed
@treefern treefern deleted the NPI-4066-reject-sp3-on-overlong-lines branch July 1, 2025 12:10
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.

2 participants