Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/python/espressomd/magnetostatics.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def validate_params(self, params):
raise TypeError("Parameter 'tune' has to be a boolean")

def required_keys(self):
return {"accuracy"}
return {"prefactor", "accuracy"}

def default_params(self):
return {"cao": -1,
Expand Down
4 changes: 4 additions & 0 deletions testsuite/python/dipolar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ def test_exceptions_p3m(self):
MDLC = espressomd.magnetostatics.DLC
dp3m_params = dict(prefactor=1., epsilon=0.1, accuracy=1e-6,
mesh=[49, 49, 49], cao=7, r_cut=4.5, alpha=0.9)
with self.assertRaisesRegex(RuntimeError, "Parameter 'prefactor' is missing"):
espressomd.magnetostatics.DipolarP3M(
**{key: value for key, value in dp3m_params.items()
if key != 'prefactor'})
with self.assertRaisesRegex(ValueError, "Parameter 'prefactor' must be > 0"):
espressomd.magnetostatics.DipolarP3M(
**{**dp3m_params, 'prefactor': -2.})
Expand Down
Loading