Skip to content

Speed up metadata extraction for large trajectory files - #65

Merged
jkalayan merged 4 commits into
mainfrom
64-bug-metadata-extration-is-slow-for-large-trajectory-files
Oct 12, 2026
Merged

jkalayan merged 4 commits into
mainfrom
64-bug-metadata-extration-is-slow-for-large-trajectory-files

Conversation

@jkalayan

Copy link
Copy Markdown
Collaborator

Summary

This pull request focuses on improving robustness and clarity in schema path resolution and trajectory metadata extraction, as well as cleaning up debugging code.

Schema path resolution improvements:

  • Updated resolve_schema_inputs to prefer args.mappingschema/args.biosimschema, but fall back to args.mapping_path/args.biosim_path if the former are not set, allowing for more flexible argument handling.
  • In main, if schema arguments are missing, now sets args.mapping_path and args.biosim_path instead of local variables, ensuring downstream functions receive the correct paths.

Trajectory metadata extraction robustness:

  • Refactored box property extraction in toptraj.py to always use the first trajectory frame's dimensions, with improved checks for trajectory existence and non-null dimensions, making the logic more reliable and faster.

Testing updates:

  • Updated test cases to include the new mapping_path and biosim_path arguments, ensuring tests accurately reflect the new input handling logic. [1] [2]

Code cleanup:

  • Removed commented-out debug print statements from both toptraj.py and populatemetadata.py for cleaner code. [1] [2]

Dependency cleanup:

  • Removed an unused import of numpy from toptraj.py.

Impact

  • Extracting dimension information by checking only the first frame of the trajectory contains dimension information (rather than iterating over frames until a dimension is found), ensures extraction completes in a timely manner (<1 minute for a 14 GB trajectory)

@jkalayan jkalayan self-assigned this Oct 12, 2026
@jkalayan jkalayan added bug Something isn't working enhancement New feature or request labels Oct 12, 2026
@jkalayan jkalayan linked an issue Oct 12, 2026 that may be closed by this pull request
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 38268906850

Coverage decreased (-0.01%) to 90.661%

Details

  • Coverage decreased (-0.01%) from the base build.
  • Patch coverage: 2 uncovered changes across 1 file (2 of 4 lines covered, 50.0%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
biosim_extractor/metadata/populatemetadata.py 4 2 50.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1028
Covered Lines: 932
Line Coverage: 90.66%
Coverage Strength: 8.16 hits per line

💛 - Coveralls

@jkalayan
jkalayan merged commit 529833f into main Oct 12, 2026
12 checks passed
@jkalayan
jkalayan deleted the 64-bug-metadata-extration-is-slow-for-large-trajectory-files branch October 12, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Metadata extration is slow for large trajectory files

2 participants