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

Docs: Add how to migrate from legacy UPF family #161

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Sep 22, 2023

The provided snippet can be used to migrate an existing UPF family, created with the aiida.orm.nodes.data.upf module from aiida-core. A PseudoPotentialFamily will be created to which the existing UpfData nodes are added, after having been converted to the UpfData class of aiida-pseudo.

@sphuber
Copy link
Contributor Author

sphuber commented Oct 3, 2023

@mbercx @mkotiuga any feedback on this? Otherwise I am going to merge this soon

pseudos.append(UpfData(handle, filename=legacy_pseudo.filename).store())

family.add_nodes(pseudos)
print(f'Migrated `{legacy_family}` to `{family}`.')
Copy link

Choose a reason for hiding this comment

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

If cutoffs also need to be set, maybe prompt the user here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cutoffs are not required. And since legacy families don't even have this concept, there is nothing to migrate really. Another part of the docs that explains how to manually create/install families goes over how to add cutoffs

Copy link

Choose a reason for hiding this comment

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

Are you sure they are not required? did this change? I remember I could not use the pseudofamilies I had made myself until I had set cutoffs for all the pseudos

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only thing that won't work is the PwBaseWorkChain.get_builder_from_protocol because that method will want to automatically set the cutoffs, and so if the family doesn't define these, it raises. However, nothing is stopping a user from defining the inputs manually. The family is just a Group with convenience methods such as PseudoFamily.get_pseudos(structure=structure) to automatically get the dictionary of pseudos that can be passed to the pseudos input.

We could perhaps think of making the cutoffs optional in the get_builder_from_protocol and not have it raise, but simply warn, so the user can specify them manually directly in the parameters input. But this is a feature request for aiida-quantumespresso really, and has nothing to do with aiida-pseudo.

@sphuber sphuber force-pushed the fix/docs-migrate-snippet branch 2 times, most recently from 4a6ae33 to 5eec3fc Compare October 9, 2023 08:45
The provided snippet can be used to migrate an existing UPF family,
created with the `aiida.orm.nodes.data.upf` module from `aiida-core`. A
`PseudoPotentialFamily` will be created to which the existing `UpfData`
nodes are added, after having been converted to the `UpfData` class of
`aiida-pseudo`.
@sphuber sphuber force-pushed the fix/docs-migrate-snippet branch from 5eec3fc to 078e40b Compare October 9, 2023 08:56
@sphuber sphuber merged commit 279d930 into main Oct 11, 2023
10 checks passed
@sphuber sphuber deleted the fix/docs-migrate-snippet branch October 11, 2023 08:37
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