Fix: MatdynParser parsing logic for phonon frequencies with k-point weights#1228
Open
ValkScripter wants to merge 1 commit intoaiidateam:mainfrom
Open
Fix: MatdynParser parsing logic for phonon frequencies with k-point weights#1228ValkScripter wants to merge 1 commit intoaiidateam:mainfrom
ValkScripter wants to merge 1 commit intoaiidateam:mainfrom
Conversation
…weights and attached frequencies Main changes in `src/aiida_quantumespresso/parsers/matdyn.py`: - Rewrote `parse_raw_matdyn_phonon_file()` function with improved regex-based parsing for robustness - Added support for k-point weights in the phonon frequencies file - Enhanced handling of malformed frequencies with attached minus signs (e.g., `-148.70828-124.2696`) - Improved error messages and validation for file format consistency Supporting changes: - Added test fixtures for k-point weights and attached frequencies cases - Extended test suite with `test_matdyn_k_weights()` and `test_matdyn_k_weights_attached()` - Updated regression data for all matdyn parser tests - Refactored test helpers to support variable mesh parameters
Collaborator
|
Many thanks @ValkScripter ! Is this PR also backward compatible with QE versions < 7.5 ? |
Member
|
@pietrodelugas does an xml output for matdyn.x exist? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request fixes #1227 and improves the robustness and flexibility of the phonon frequencies parsing logic, allowing it to handle files with k-point weights and poorly formatted frequency lines (such as attached minus signs as before but with RE):
parse_raw_matdyn_phonon_fileto use regular expressions to robustly parse k-point and frequency blocks, including cases with attached minus signs and k-point weights.test_matdyn_k_weightsandtest_matdyn_k_weights_attached) to verify the parser correctly handles phonon frequencies files that include k-point weights and cases with attached minus signs in frequency values with more than only one k-point to check that different k-points are read correctly and that no gradual shift in phonon frequencies happens.