Allow null pseudo_family by extracting z_valence from pseudos - #1100
Allow null pseudo_family by extracting z_valence from pseudos#1100edan-bainglass wants to merge 3 commits into
pseudo_family by extracting z_valence from pseudos#1100Conversation
72ee6d8 to
b8f19d8
Compare
c17c439 to
339824a
Compare
339824a to
d7a31d8
Compare
|
Thanks @edan-bainglass! Is this urgent? I'd like to have a think on how to best deal with custom pseudo potentials. I.e. perhaps it should be easier to define a Could you also point me to an example how this new feature is used? |
Hi @mbercx. See referenced PR from the QE app. Urgent enough that its pseudo upload widget wasn't actually an operational feature. That PR addresses the issue (restores compatibility), but to submit successfully, this PR would be required. Would it be possible to get this merged and think of an improved/optimal implementation later? |
|
@edan-bainglass Just some general comments from my side:
Since I have been playing around with several pseudos lately, where I was only changing individual ones and didn't care about a whole PP library/family, I would prefer to not add this additional step of forcing the user to first use
Wouldn't this somehow counteract the idea of the builder that you only have to call a single function to get a final builder, potentially including custom modifications based on the provided overrides. Just to say, I personally find it a bit odd to remove certain aspects from the overrides (again, assuming that I understood your comment correctly), e.g., that I can't directly modify the pseudos etc. in the builder, but everything else. |
|
@edan-bainglass Ah, final comment, I think that we should at least add/adjust tests to check that this new logic works as expected, especially if we want to merge it now and think about an optimal UX later. |
|
Thanks @t-reents, I agree with both your comments. I think I was mainly giving some off the cuff comments to try and procrastinate on the pseudo overrides issue. ^^ But let's bite the bullet. Having a closer look now, this PR is indeed trying to fix some bugs with overriding pseudos in the
However, in the current implementation, these issues still (silently) persist unless the user explicitly sets the @t-reents since you've playing around with custom pseudos outside the scope of the QEapp: one question I'm still thinking about: should the user be able to override the pseudo potential for one kind and still take the others from the pseudo family? A second change I'd make is to the @edan-bainglass since I'm introducing a bit of scope creep here, happy to take over to get these bug fixes in for all |
Sure @mbercx. Can you please provide a rough estimate for completion on this? Reminder that aiidalab/aiidalab-qe#1348 is blocked by this 🙂 |
|
I'll work on it first thing tomorrow Aussie time, so it will be ready for you to test in the QEapp by the time you have your morning coffee. 😉 |
The `generate_upf_data` is used to generate a minimal `UpfData` node. Currently it only allows you to determine the element of the pseudo potential. Here we introduce a new `z_valence` input to the fixture for setting the number of valence electrons.
Add a first version of tests to demonstrate the issues with overriding pseudo potentials when not setting `pseudo_family` to `None`, and also verify that these tests pass when this _is_ the case.
|
@edan-bainglass I've added some basic tests (to be condensed) in this PR to demonstrate the two issues with overriding pseudo potentials, and that these are resolved in case the I'll work on adapting the code so all these tests pass in a separate PR. EDIT: Working on new version in #1102 Since the tests will be refactored in that PR, I show that the changes pass the tests I introduced in this PR here: https://github.com/mbercx/aiida-quantumespresso/actions/runs/16612834078/job/46999197620 The old |
|
Superseded by #1102. Thanks again @edan-bainglass for finding this issue and the fix! |
In the pw base workchain's
get_builder_from_protocolmethod, we use thepseudo_familyinput (str) to fetch the family and use it to define defaults for pseudos and cutoffs, as well as to obtain the Z value for converting moments to starting magnetization. This PR removes the dependency onpseudo_familyby relying on the overrides for pseudos and cutoffs (now required if no pseudo family provided), as well by constructing az_valencesdictionary from the pseudos themselves and using it in the magnetization conversion. By removing the dependency, this PR allows scenarios where pseudos are provided that do not belong to the supported families (e.g., uploading custom pseudos in the QE app).