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

CLI: separate established families from non-established ones #94

Closed

Commits on Jun 11, 2021

  1. CLI: filter cutoffs from JSON file for family cutoffs set

    Currently the `family cutoffs set` command requires that the JSON file
    that contains the cutoffs _only_ has the cutoff keys specified for each
    element. This is because the cutoffs are validated by the
    `RecommendedCutoffMixin.validate_cutoffs()` method, which doesn't allow
    for extraneous keys.
    
    However, the  `.json`  file could have been adapted by the user from e.g. the
    SSSP `metadata.json` or some other dictionary that also contains other keys.
    As long as the cutoff keys are defined, we shouldn't raise an error just because
    there are other keys present.
    
    Here we first filter the data loaded from the JSON file for the cutoffs,
    before passing the dictionary to the `set_cutoffs` method.
    mbercx committed Jun 11, 2021
    Configuration menu
    Copy the full SHA
    fe4e7db View commit details
    Browse the repository at this point in the history
  2. CLI: block family cutoffs set for established families

    One of the motivations of having dedicated and automated CLI commands to
    install established pseudpotential families like the SSSP or the
    Pseudo-dojo normconserving pseudopotentials is to try and prevent that
    the pseudopotentials or recommended cutoffs deviate from the official
    ones. However, the `family cutoffs set` command currently allows the
    user to change the recommended cutoffs easily through the CLI.
    
    In order to prevent this, we block usage of the command for `SsspFamily`
    and `PseudoDojoFamily`'s, by adding an `exclude` input argument to the
    `PseudoPotentialFamilyParam`, where the entry points of the classes that
    should be disallowed can be provided. This is then used to adapt the
    option decorator for the `PSEUDO_POTENTIAL_FAMILY` input argument of
    `family cutoffs set`.
    
    Note that the user _can_ still install e.g. the SSSP with their own
    recommended cutoffs using the `install family` command as a
    `CutoffsPseudoPotentialFamily`. However, the `SsspFamily` class is
    reserved for pseudopotentials installed with the automated install
    command.
    mbercx committed Jun 11, 2021
    Configuration menu
    Copy the full SHA
    f2c4ad7 View commit details
    Browse the repository at this point in the history
  3. CLI: add install --from-dir for sssp and pseudo-dojo

    Our workaround for installing an "established" family like a `SsspFamily`
    or `PseudoDojoFamily` required using the `install family` command, but
    this is explicitly forbidden since we do not want the user to be able to
    install an arbitrary set of pseudopotentials as one of these classes.
    This means there is currently no way to install the archive and metadata
    obtained with the `--download` option of the automated install commands.
    
    Here, we add the `--from-dir` option to the automated install commands
    to allow the user to install the downloaded pseudopotentials and set the
    recommended cutoffs automatically for an `SsspFamily` or
    `PseudoDojoFamily`.
    mbercx committed Jun 11, 2021
    Configuration menu
    Copy the full SHA
    b60911e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f178ea2 View commit details
    Browse the repository at this point in the history