-
Notifications
You must be signed in to change notification settings - Fork 103
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
Update _split_one_line and remove whitespace parameter #686
Conversation
CodSpeed Performance ReportMerging #686 will degrade performances by 19.46%Comparing Summary
Benchmarks breakdown
|
Hi, thanks for preparing this PR. The benchmarks show that this variant is indeed slightly faster than than the regex-based one. However is still about 40% slower than the fast Still, I tend towards accepting this change, because it is much cleaner and technically gives the correct result, while currently it does not. If high performance is desired, I would recommend using BinaryCIF anyway. @biotite-dev has anyone a strong opinion about it? I probably need a few more days to review the code, but for now could you reformat the code with |
Fixes #673 |
I tryed to reduce/optimize the code a bit more, but it seems there is no real gain... |
This is okay, a few other people (including me) already tried that unsuccessfully. After Rust code is introduced into the project (#688), this is probably the first function that is replaced by fast Rust routine. The PDBx test is currently failing, as it does not expect a generator. Could you either revert to the non-generator variant or adapt the test? |
fdafb18
to
33f1936
Compare
Finally, all tests are fine and branch is up to date! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only found this small typo. Otherwise the PR looks good to merge!
src/biotite/structure/io/pdbx/cif.py
Outdated
# Loop over the line | ||
while line: | ||
# Strip leading whitespace(s) | ||
striped_line = line.lstrip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a small typo
striped_line = line.lstrip() | |
stripped_line = line.lstrip() |
Typo fixed! Thanks. |
This is an attempt to update _split_one_line function to avoid usage of 'whitespace' parameter and approximation made for '_atom_site' CIF block.
Performance have to be approved with a CI run.