Skip to content

⚡ Bolt: Fast Extended XYZ metadata parsing via read_extxyz_info_fast#498

Open
alinelena wants to merge 1 commit intomainfrom
bolt-fast-extxyz-info-read-4276595547892877527
Open

⚡ Bolt: Fast Extended XYZ metadata parsing via read_extxyz_info_fast#498
alinelena wants to merge 1 commit intomainfrom
bolt-fast-extxyz-info-read-4276595547892877527

Conversation

@alinelena
Copy link
Copy Markdown
Collaborator

💡 What: Introduced read_extxyz_info_fast utility to quickly extract metadata from Extended XYZ files, completely bypassing the heavy full-coordinate structure parser of ase.io.read(). It was applied to Relastab and Defectstab analysis scripts where system and subset labels are fetched from atoms.info.

🎯 Why: In loops traversing many large .xyz structure files (which is common in this codebase for metrics extraction), reading the entire atoms object just to access the .info dictionary causes severe slowdowns. Since .info is stored entirely on the second line of the file, we can parse it in O(1) time.

📊 Impact: Massively reduces I/O parsing overhead during metric generation for defect analysis, speeding up test collection and metric generation times, particularly as datasets scale up. Avoids large memory allocations from ASE Atom objects that are immediately discarded.

🔬 Measurement: Run the analysis pipelines for Defectstab or Relastab with large data sets, or observe the test suite timing which remains steady without introducing regressions.


PR created automatically by Jules for task 4276595547892877527 started by @alinelena

This commit introduces a significant performance improvement when analyzing
extended xyz (.xyz) files. Many scripts loop over these files using
`ase.io.read()` solely to extract the `atoms.info` dictionary. This causes
the full structural parsing of the coordinate system, cell, and properties.

By introducing and using `read_extxyz_info_fast`, which directly leverages
`ase.io.extxyz.key_val_str_to_dict` to only parse the second line (the properties
line) of the file, we bypass the expensive full-structure reading.

Affected files:
- `ml_peg/analysis/utils/utils.py`
- `ml_peg/analysis/defect/Relastab/analyse_Relastab.py`
- `ml_peg/analysis/defect/Defectstab/analyse_Defectstab.py`

A minor bug fix regarding `labels_list` initialization in `solvMPCONF196`
was also included.

Co-authored-by: alinelena <3306823+alinelena@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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.

1 participant