Parsing scan sizes of EMPAD data#520
Open
matao1984 wants to merge 2 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #520 +/- ##
==========================================
+ Coverage 88.37% 88.86% +0.49%
==========================================
Files 108 113 +5
Lines 12265 13053 +788
Branches 2276 2415 +139
==========================================
+ Hits 10839 11600 +761
- Misses 898 912 +14
- Partials 528 541 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ericpre
reviewed
Jun 10, 2026
ericpre
left a comment
Member
There was a problem hiding this comment.
This looks good - I will double check with some old files but it seems that this is already covered in the test suite.
The tests are checking the shape of the array but the shape of the navigation and signal and I think that it would be good to check these too! Can you please update the tests accordingly?
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.
For issue #513
Description of the change
Modified the parsing logic for the scan sizes. Now the reader looks for the raw file name with a pattern of "scan_xaaa_ybbb.raw", in which the "aaa" and "bbb" are the scan sizes for x and y, respectively. All tests passed.
The reason for this change:
The EMPAD metadata (xml) saves two sets of scan parameters tagged "search" and "acquire" with the exactly same keys. When _parse_xml reads these keys it does not distinguish the different tags so the "search" keys are overwritten by the "acquire" keys. The original logic reads the scan sizes from these keys. Therefore, the parsed scan sizes are always from the "acquire" parameters. This may work most of the time because users usually use "acquire" to take the datasets. However, it will fail if the actual dataset has been taken with the "search" parameters (which the current EMPAD GUI does not forbid you to). On the other hand, at least up to the current version of EMPAD GUI v1.2.2 the raw file name is always in the pattern of "scan_xaaa_ybbb.raw". So this should be a safer way to parse the scan sizes.
Progress of the PR
upcoming_changesfolder (seeupcoming_changes/README.rst),docs/readthedocs.org:rosettasciiobuild of this PR (link in github checks)