-
Notifications
You must be signed in to change notification settings - Fork 82
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
projwfc.x
: parse from XML instead of parent calc
#747
Conversation
This PR is still blocked since it builds on #741 (I used the Here I simply switch to parsing the XML, but leave the 🍝 -code of the parser. I'll open a second PR soon with the new (and hopefully more readable) code. I split these up for a couple of reasons:
|
@sphuber one thing I was considering is that we duplicate a lot of files in the repository by retrieving the XML file. I suppose it would be better to instead add the XML file to the Additionally, I was wondering if we should move the PDOS files (e.g. |
0d5870f
to
20aa631
Compare
In the end I decided to only move the XML file to the temporary retrieve list here, since technically no longer retrieving the PDOS files is backwards incompatible. I've added this to #749 instead. Note: Please don't pay too much attention to coding style for this PR. I've reworked the code a lot in #749, so leave coding style comments for that one. I too was very annoyed by the use of |
20aa631
to
c28d19c
Compare
@qiaojunfeng I've adapted the branch so it no longer builds on top of #741, so it's ready for review. I guess the main question is if this allows you to simplify the definition of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Marnik! Only few minor issues.
With (aiidateam#747) the `ProjwfcParser` has no implicit requirements on parent calculation. The code for compatibility with `ProjwfcCalculation` is now removed.
f2ccbc6
to
c50af41
Compare
82a3794
to
f9d401e
Compare
@qiaojunfeng I've fixed the failure to return the XML exit codes and added some tests. I've also refactored the tests a bit to use One final question I still had here: Since the |
Thanks @mbercx , all look good to me!
Yes I think so, these post-processing codes need to read the |
Thanks @qiaojunfeng! I'll just wait for a final sign-off from @sphuber, since he still raised some questions above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mbercx if you just add the comment to the code why XML is retrieved as temporary, then this is good to go for me :+:
The current `ProjwfcParser` uses several in and output nodes from the parent calculation. This increased the complexity of the tests for this parser, and made running `opengrid.x` in between the `pw.x` and `projwfc.x` run impossible without adding these in and output nodes to the calculation job of `opengrid.x`. Here we switch to parsing the XML instead of relying on the parent calculation. The `data-file-schema.xml` of the parent calculation is retrieved and parsed, providing the required information for the subsequent parsing of the `projwfc.x` output. All the parsing tests are updated to include the XML output file and remove the in/output links for the parent calculation. The `convert_qe_to_kpoints` function is added to convert the k-points data in the XML to a `KpointsData` node.
0478536
to
51c4c04
Compare
@sphuber Locked 'n loaded, jefe! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¡Ándale ándale!
The current `ProjwfcParser` uses several in and output nodes from the parent calculation. This increased the complexity of the tests for this parser, and made running `opengrid.x` in between the `pw.x` and `projwfc.x` run impossible without adding these in and output nodes to the calculation job of `opengrid.x`. Here we switch to parsing the XML instead of relying on the parent calculation. The `data-file-schema.xml` of the parent calculation is retrieved and parsed, providing the required information for the subsequent parsing of the `projwfc.x` output. All the parsing tests are updated to include the XML output file and remove the in/output links for the parent calculation. Note that the XML file is added to the temporary retrieve list since although it is required for parsing, it is already in repository of a an ancestor calculation. The `convert_qe_to_kpoints` function is added to convert the k-points data in the XML to a `KpointsData` node.
In aiidateam#747 we adjusted the parser for `projwfc.x` to rely on the XML file instead of the provenance for obtaining the structure. This worked fine for structures that have chemical symbols as kind names, but once the kind labels contain numbers the `convert_qe2aiida_structure` failed to generate the `StructureData` based on the XML content since this case is not considered. Here we rename this method to `convert_qe_to_aiida_structure` and make it more flexible by also adding the case of numbered kind names. This is simply done by removing any digits from the kind names in the XML to obtain the corresponding `symbol` of the kind name.
In aiidateam#747 we adjusted the parser for `projwfc.x` to rely on the XML file instead of the provenance for obtaining the structure. This worked fine for structures that have chemical symbols as kind names, but once the kind labels contain numbers the `convert_qe2aiida_structure` failed to generate the `StructureData` based on the XML content since this case is not considered. Here we rename this method to `convert_qe_to_aiida_structure` and make it more flexible by also adding the case of numbered kind names. This is simply done by removing any digits from the kind names in the XML to obtain the corresponding `symbol` of the kind name.
In aiidateam#747 we adjusted the parser for `projwfc.x` to rely on the XML file instead of the provenance for obtaining the structure. This worked fine for structures that have chemical symbols as kind names, but once the kind labels contain numbers the `convert_qe2aiida_structure` failed to generate the `StructureData` based on the XML content since this case is not considered. Here we rename this method to `convert_qe_to_aiida_structure` and make it more flexible by also adding the case of numbered kind names. This is simply done by removing any digits from the kind names in the XML to obtain the corresponding `symbol` of the kind name.
In #747 we adjusted the parser for `projwfc.x` to rely on the XML file instead of the provenance for obtaining the structure. This worked fine for structures that have chemical symbols as kind names, but once the kind labels contain numbers the `convert_qe2aiida_structure` failed to generate the `StructureData` based on the XML content since this case is not considered. Here we rename this method to `convert_qe_to_aiida_structure` and make it more flexible by also adding the case of numbered kind names. This is simply done by removing any digits from the kind names in the XML to obtain the corresponding `symbol` of the kind name.
With (aiidateam#747) the `ProjwfcParser` has no implicit requirements on parent calculation. The code for compatibility with `ProjwfcCalculation` is now removed.
With (aiidateam#747) the `ProjwfcParser` has no implicit requirements on parent calculation. The code for compatibility with `ProjwfcCalculation` is now removed.
Fixes #299
The current
ProjwfcParser
uses several in and output nodes from theparent calculation. This increased the complexity of the tests for this
parser, and made running
opengrid.x
in between thepw.x
andprojwfc.x
run impossible without adding these in and output nodes tothe calculation job of
opengrid.x
.Here we switch to parsing the XML instead of relying on the parent
calculation. The
data-file-schema.xml
of the parent calculation isretrieved and parsed, providing the required information for the
subsequent parsing of the
projwfc.x
output. All the parsing tests areupdated to include the XML output file and remove the in/output links
for the parent calculation.
The
convert_qe_to_kpoints
function is added to convert the k-pointsdata in the XML to a
KpointsData
node.