-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI: Simplify
cli.utils.validate_hubbard_parameters
and add tests (#…
…909) The `validate_hubbard_parameters` method defined `hubbard_file_pk` as an argument which can take a `SinglefileData` with Hubbard parameters or a pk. However, the only methods calling it, are CLI commands that pass in a value provided by the `options.HUBBARD_FILE` reusable option which already loads the node corresponding to the identifier specified in the command line arguments. It also ensures that it is a `SinglefileData`. Therefore, the signature can be simplified to just accept a node and do away with the manual loading and type checking. This also allows to change the return type to `None` as the node is no longer loaded by the validation method but is passed in as an argument. A test is added that runs the `calculation launch pw` command with the `--hubbard-u` or `--hubbard-file` options, both with valid and invalid options to test the validation function. Co-authored-by: Sebastiaan Huber <[email protected]>
- Loading branch information
Showing
7 changed files
with
59 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters