Skip to content

Commit

Permalink
Ensure _'s in WB97x_D3 don't cause problems
Browse files Browse the repository at this point in the history
  • Loading branch information
WardLT committed Jan 18, 2024
1 parent b9e5a3a commit 1c9d3c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examol/simulate/ase/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def create_configuration(self, name: str, xyz: str, charge: int, solvent: str |
}
elif name.startswith('cp2k_'):
# Get the name the basis set
xc_name, basis_set_id = name.rsplit('_', 2)[-2:]
xc_name, basis_set_id = name[5:].rsplit('_', 1)
xc_name = xc_name.upper()

# Determine the proper basis set, pseudopotential, and method
Expand Down
8 changes: 8 additions & 0 deletions tests/simulation/test_ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ def test_cp2k_configs(tmpdir, strc):
assert 'GAPW' in config['kwargs']['inp']
assert Path(config['kwargs']['basis_set_file']).is_file()

# With wb97x-d3
config = sim.create_configuration('cp2k_wb97x_d3_tzvpd', strc, charge=1, solvent=None)
assert config['kwargs']['cutoff'] == 600 * units.Ry
assert config['kwargs']['charge'] == 1
assert config['kwargs']['uks']
assert 'GAPW' in config['kwargs']['inp']
assert Path(config['kwargs']['basis_set_file']).is_file()

# With an undefined basis set
with raises(AssertionError):
sim.create_configuration('cp2k_blyp_notreal', strc, charge=1, solvent=None)
Expand Down

0 comments on commit 1c9d3c2

Please sign in to comment.