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

[XPS] support multiple core levels for the same element #16

Merged
merged 7 commits into from
Feb 12, 2025

Conversation

superstar54
Copy link
Contributor

@superstar54 superstar54 commented Feb 7, 2025

workchain support multiple core levels for the same elements

for example, 1s, 2s, 2p for Al:

Screenshot from 2025-02-08 11-19-35

GUI to allow user specific the atom indices to be considered.

Screenshot from 2025-02-08 11-23-13

@superstar54 superstar54 marked this pull request as draft February 7, 2025 22:08
@superstar54 superstar54 marked this pull request as ready for review February 8, 2025 11:08
@superstar54
Copy link
Contributor Author

Hi @PNOGillespie , if you have time to review this PR today, that would be great. Otherwise, would it be okay for me to merge it today so that a user can start testing this new feature?

Copy link
Collaborator

@PNOGillespie PNOGillespie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @superstar54. The feature here does seem useful, however there are some issues regarding input validation which need resolving before this will be good to go.

I've left some comments on the various changes, but the main things which need changing are:

  1. There is no input validation for core_levels or core_hole_pseudos. I understand that this automatically done when loading in your pseudo_demo pseudopotentials - however when working with other pseudopotentials, the lack of validation can result in the WorkChain excepting only at the end of a run due to simple spelling/formatting errors.
  2. Docstrings (at least for the workflows) should be updated to include these new parameters, in addition to something showing how they need to be formatted.

I will have another look at this once these two points have been addressed.

- Add input validation
- Update docstring
@superstar54
Copy link
Contributor Author

superstar54 commented Feb 10, 2025

Hi @PNOGillespie , thanks for the review. I have implemented suggestions, in the commit: c6c9ef7, also with tests.

I have added the following validation:

  • keys of core_levels should be a subset of the structure elements and core_hole_pseudos
  • atom_indices should be in the range of the number of atoms in the structure
  • all the elements corresponding to the atom indices should be in the core_hole_pseudos

Copy link
Collaborator

@PNOGillespie PNOGillespie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @superstar54. Thanks for addressing some of the changes and adding tests. I have one last point which I think maybe wasn't made clear in the previous review.

We can probably go ahead and merge after addressing that last point.

Copy link
Collaborator

@PNOGillespie PNOGillespie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @superstar54. Please take a look at the comment for this review - I don't think we're quite there yet with input validation.

Please let me know if anything about it is unclear.

@superstar54
Copy link
Contributor Author

Hi @PNOGillespie, thanks for your feedback!

I've added more input validation along with corresponding tests in this commit: f4ea8f3.

These improvements should make the input validation more robust and help catch potential issues early. Let me know if you have any further suggestions!

Copy link
Collaborator

@PNOGillespie PNOGillespie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes @superstar54. The input scheme is now a lot more robust for workflow users.

Just need to update the help string for core_hole_pseudos and I think we're done here.

Comment on lines 96 to 104
spec.input_namespace(
'gipaw_pseudos',
valid_type=(orm.UpfData, UpfData),
dynamic=True,
help=(
'Dynamic namespace for pairs of ground-state pseudopotentials for each absorbing'
' element. Must use the mapping "{element}" : {Upf}".'
)
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this part has been removed, and the gipaw_pseudos has been merged into core_hole_pseudos, the help string for core_hole_pseudos needs to be updated for the new input format.

Doesn't need to be extensive, just something like:

'Dynamic namespace for ground-state and core-hole pseudopotentials for each absorbing'
' element. Must use the mapping "{element}" : {"gipaw" : {Upf}, "1s" : {Upf}}".'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, in commit: 3b52fcb

@PNOGillespie
Copy link
Collaborator

Good work @superstar54! Go ahead and merge this.

@superstar54 superstar54 merged commit db98433 into main Feb 12, 2025
1 check passed
@superstar54 superstar54 deleted the support_multiple_core_levels branch February 12, 2025 09:07
@superstar54
Copy link
Contributor Author

@PNOGillespie Thank you for the review!

@superstar54
Copy link
Contributor Author

Hi @PNOGillespie , I think it's good to make another release (v0.1.1) to include the new functionality. I will do it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants