Skip to content

Commit

Permalink
more verbose error messages from md
Browse files Browse the repository at this point in the history
  • Loading branch information
bernstei committed Oct 31, 2024
1 parent 5a00ca7 commit e534acb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wfl/generate/md/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _get_pressure(atoms):
def _get_temperature(atoms):
temperature_use = atoms.info.get("WFL_MD_TEMPERATURE", temperature)

if temperature_tau is None and (temperature_use is not None and not isinstance(temperature_use, (float, int))):
if temperature_tau is None and (temperature_use is not None and not isinstance(temperature_use, (float, int, np.floating, np.integer))):
raise RuntimeError(f'NVE (temperature_tau is None) can only accept temperature=float for initial T, got {type(temperature_use)}')

if temperature_use is not None:
Expand Down Expand Up @@ -191,7 +191,7 @@ def _get_temperature(atoms):
if temperature_tau is None:
# NVE
if pressure_use is not None:
raise RuntimeError('Cannot do NPH dynamics')
raise RuntimeError(f'Got pressure {pressure_use} but no active thermostat temperature_tau={temperature_tau}. Can only do NPT, not NPH, dynamics')
md_constructor = VelocityVerlet
# one stage, simple
all_stage_kwargs = [stage_kwargs.copy()]
Expand Down

0 comments on commit e534acb

Please sign in to comment.