Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PseudoPotentialFamily
: add the pseudo_type
extra
Since pseudopotential families can now optionally support many pseudopotential formats, although each instance only supports one format at a time, it should be easy to determine which format any particular family hosts. The `pseudo_type` property is added to `PseudoPotentialFamily` which returns the entry point name of the `PseudoPotentialData` subclass that is used by the pseudopotentials that it contains. For example, if the family hosts only `UpfData` nodes, whose entry point string is defined as `aiida.data:pseudo.upf`, it will return `pseudo.upf`. Note that the entry point group `aiida.data` is stripped as it is redundant information. The `pseudo_type` is stored as an extra on the family instance and is updated after the node contents are mutated, i.e. after `add_nodes`, `remove_nodes` and `clear. Having this information stored as an extra and not calculated each time on the fly, not only helps efficiency but it also makes it queryable, which is important if one needs to find a family with pseudos of a particular type. The class does not provide a `pseudo_type` setter as this only ever needs to be set by the class itself. Users can of course always change the value through the `set_extra` method of the `Group` class, causing inconsistency in the data, but there is nothing one can do to protect against this.
- Loading branch information