Skip to content
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

parse query on Select object creation #61

Merged
merged 3 commits into from
Nov 23, 2024

Conversation

lmiq
Copy link
Contributor

@lmiq lmiq commented Nov 22, 2024

This PR makes the use of the selection string @sel_str much faster, because the query is parsed on the construction of the object, and not on the application of the query to each atom. For example:

Before:

julia> struc = retrievepdb("4YC6")

julia> @btime collectatoms($struc, $(sel"name CA"));
  37.468 ms (605588 allocations: 16.10 MiB)

After:

julia> @btime collectatoms($struc, $(sel"name CA"));
  889.474 μs (41122 allocations: 2.06 MiB)

Also, the Select object has a custom show method:

julia> sel"name CA and resnum 1"
Select("name CA and resnum 1")

@lmiq lmiq marked this pull request as ready for review November 22, 2024 20:00
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.95%. Comparing base (a98a59d) to head (f1d622b).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #61      +/-   ##
==========================================
+ Coverage   94.93%   94.95%   +0.01%     
==========================================
  Files          14       14              
  Lines        1897     1901       +4     
==========================================
+ Hits         1801     1805       +4     
  Misses         96       96              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@jgreener64 jgreener64 merged commit 29d70e2 into BioJulia:master Nov 23, 2024
9 checks passed
@jgreener64
Copy link
Member

Thanks a lot!

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