Skip to content
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

ProjwfcParser: refactor code and temp retrieve PDOS files #749

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mbercx
Copy link
Member

@mbercx mbercx commented Oct 3, 2021

Massive refactoring of the ProjwfcParser to make the code less entangled
and more readable.

TODO:

Fixes two issues when using the `PdosWorkChain`:

1. Remove the validation of the `parent_folder` input for `nscf`
`PwCalculation`s. This made it impossible to use the `PdosWorkChain`
with an initial `scf` run, since the `parent_folder` is only created
inside the logic of the work chain, and hence cannot be provided as an
input upon submission.
2. In the `PdosWorkChain.get_builder_from_protocol()` method, override
the `occupations` setting to make sure it is set to `tetrahedra`.
Although this setting is also passed to the overrides from the `yaml`
file that defines the protocol, if the user sets
`ElectronicType.INSULATOR`, the occupations is set to `fixed` in the
`PwBaseWorkChain.get_builder_from_protocol()` method.
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.
@mbercx mbercx added this to the v4.0.0 milestone Oct 3, 2021
@mbercx mbercx added the pr/blocked PR is blocked by another PR that should be merged first label Oct 3, 2021
@mbercx mbercx force-pushed the fix/748/clean-projwfc-parser branch from 4040d49 to 581bd57 Compare October 3, 2021 16:28
@mbercx
Copy link
Member Author

mbercx commented Oct 3, 2021

Note: the Python 3.6 tests fail because numpy.ArrayLike requires a numpy version that no longer supports Python3.6. However, since the EOL of Python 3.6 is in a couple months and the PR is meant to go into v4.0.0, I think we can just leave it as is and drop Python 3.6 support before we merge it.

More importantly, the tests succeed for 581bd57 and Python >= 3.7, without touching the tests. I've also run both the old parser and refactored one for the 4 different spin settings, and compared the content of the orbitals and PDOS arrays. So I'm quite confident that the parsing is unaltered.

@mbercx mbercx added the pr/on-hold PR should not be merged label Oct 3, 2021
@mbercx
Copy link
Member Author

mbercx commented Oct 3, 2021

@sphuber this PR is both blocked by #747 and on hold because it contains backwards incompatible changes:

  • Drop support for pre-v6.5 QE versions.
  • Only temporarily retrieve the PDOS files to lighten the repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/blocked PR is blocked by another PR that should be merged first pr/on-hold PR should not be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant