Skip to content

Commit

Permalink
Merge pull request #89 from MolarVerse/hotfix/1.0.12
Browse files Browse the repository at this point in the history
Fix: continue_input now giving correct error messages
  • Loading branch information
97gamjak authored Jun 1, 2024
2 parents 609e239 + 1bd10ad commit 9a9bcea
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ build/
_version.py
**/*.ipynb

.github/.pylint_cache

.coverage
coverage.xml
htmlcov/
Expand Down
15 changes: 7 additions & 8 deletions PQAnalysis/io/input_file_reader/pq/output_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ def start_file(self) -> str:
@property
def is_start_file_defined(self) -> bool:
"""bool: Whether a start file is defined in the input file."""
try:
_ = self.start_file

if "start_file" in self.dictionary.keys():
return True
except PQKeyError:
return False

return False

@property
def rpmd_start_file(self) -> str:
Expand All @@ -54,11 +54,10 @@ def rpmd_start_file(self) -> str:
@property
def is_rpmd_start_file_defined(self) -> bool:
"""bool: Whether a rpmd start file is defined in the input file."""
try:
_ = self.rpmd_start_file
if "rpmd_start_file" in self.dictionary.keys():
return True
except PQKeyError:
return False

return False

@property
def restart_file(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion PQAnalysis/io/input_file_reader/pq/pq_input_file_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def _get_digit_string_from_filename(filename: str) -> str:
if filename does not contain a number to be parsed
"""

if (regex := re.search(r"\d+.", filename)) is None:
if (regex := re.search(r"\d+\.", filename)) is None:
PQInputFileReader.logger.error(
(
f"Filename {filename} does not contain a number to be "
Expand Down
44 changes: 44 additions & 0 deletions examples/continue_input/run-01.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Type of this run
jobtype = qm-md;
# dim = 3d;

# Number of steps to be performed and timestep in fs; nreset gives the first n steps in which the total momentum is reset
nstep = 20000; timestep = 2.0; nreset = 5;

# Time integration algorithm
integrator = v-verlet;

# Request computation of the stress tensor
# (IMPORTANT for virial calculation to the correct pressure)
virial = atomic; # stress_tensor = on;

# Output frequency of ALL data files
output_freq = 2;

# Generate Start velocities instead of taking them from the .rst file
# init_velocities = true;

# Temperature algorithm (Berendsen), Target T in K and Relaxation time in ps
thermostat = velocity_rescaling; temp = 298.15; t_relaxation = 0.1;

# Pressure coupling algorithm, Target p in bar and Relaxation time in ps
# manostat = berendsen; pressure = 1.013; p_relaxation = 10.0;

# QM Program and QM script to run the program and parse its output
qm_prog = dftbplus; qm_script = dftbplus_periodic_stress;

# Activate shake algorithm
shake = on;

# Files

start_file = initial_mil68ga.rst;
topology_file= shake.top;

output_file = mil68ga-md-01.out;
info_file = mil68ga-md-01.info;
energy_file = mil68ga-md-01.en;
traj_file = mil68ga-md-01.xyz;
vel_file = mil68ga-md-01.vel;
charge_file = mil68ga-md-01.chrg;
restart_file = mil68ga-md-01.rst;

0 comments on commit 9a9bcea

Please sign in to comment.