Skip to content

pad short lines when reading from non-file io#24

Merged
padix-key merged 2 commits intobiotite-dev:mainfrom
kleinhenz:short_lines
May 27, 2025
Merged

pad short lines when reading from non-file io#24
padix-key merged 2 commits intobiotite-dev:mainfrom
kleinhenz:short_lines

Conversation

@kleinhenz
Copy link
Contributor

Makes the behavior match between reading from io.StringIO and reading from a file.

kleinhenz added 2 commits May 21, 2025 14:56
This makes the behavior using io.StringIO match the behavior when reading from a file
@padix-key
Copy link
Member

Hi, thanks for the contribution. In general I think this is a good idea. Let's wait for the CI to see the performance impact on this. As alternative we could also justify the line on the Rust side, if the impact is measurable.

@kleinhenz
Copy link
Contributor Author

I had originally put this in the constructor on the rust side but then I didn't want to make it happen twice in the more common read path. I didn't measure the performance though so maybe it doesn't really make a big difference.

@padix-key
Copy link
Member

I didn't want to make it happen twice

Now I understand what you mean, I forgot that these lines existed.

fastpdb/src/lib.rs

Lines 76 to 78 in 64d6b14

let lines = contents.lines().map(
|line| format!("{:<80}", line)
).collect();

In this case this seems like a sensible solution to me, thanks 👍

@padix-key padix-key merged commit d916041 into biotite-dev:main May 27, 2025
16 checks passed
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