Skip to content

Commit

Permalink
First round of review
Browse files Browse the repository at this point in the history
  • Loading branch information
mbercx committed Oct 10, 2022
1 parent 63abf88 commit 302688e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/aiida_pseudo/cli/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ def cmd_family_cutoffs_set(family, cutoffs, stringency, unit): # noqa: D301
try:
cutoffs_dict[element] = {'cutoff_wfc': values['cutoff_wfc'], 'cutoff_rho': values['cutoff_rho']}
except KeyError as exception:
raise click.BadParameter(f'`{cutoffs.name}` is missing cutoffs for element: {element}') from exception
raise click.BadParameter(
f'`{cutoffs.name}` is missing cutoffs for element `{element}`: {exception}', param_hint='CUTOFFS'
) from exception

try:
family.set_cutoffs(cutoffs_dict, stringency, unit=unit)
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/test_family.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_family_cutoffs_set(run_cli_command, get_pseudo_family, generate_cutoffs
assert sorted(family.get_cutoff_stringencies()) == sorted(['low', 'normal', 'high'])
assert family.get_cutoffs(stringency) == cutoffs_dict[stringency]

# Invalid cutoffs structure - Should pass fine
# Additional keys in the cutoffs should be accepted and simply ignored
stringency = 'invalid'
high_cutoffs = deepcopy(cutoffs_dict['high'])
high_cutoffs['Ar']['GME'] = 'moon'
Expand Down

0 comments on commit 302688e

Please sign in to comment.