Skip to content

Commit 9a9bcea

Browse files
authored
Merge pull request #89 from MolarVerse/hotfix/1.0.12
Fix: continue_input now giving correct error messages
2 parents 609e239 + 1bd10ad commit 9a9bcea

File tree

4 files changed

+54
-9
lines changed

4 files changed

+54
-9
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ build/
66
_version.py
77
**/*.ipynb
88

9+
.github/.pylint_cache
10+
911
.coverage
1012
coverage.xml
1113
htmlcov/

PQAnalysis/io/input_file_reader/pq/output_files.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ def start_file(self) -> str:
4040
@property
4141
def is_start_file_defined(self) -> bool:
4242
"""bool: Whether a start file is defined in the input file."""
43-
try:
44-
_ = self.start_file
43+
44+
if "start_file" in self.dictionary.keys():
4545
return True
46-
except PQKeyError:
47-
return False
46+
47+
return False
4848

4949
@property
5050
def rpmd_start_file(self) -> str:
@@ -54,11 +54,10 @@ def rpmd_start_file(self) -> str:
5454
@property
5555
def is_rpmd_start_file_defined(self) -> bool:
5656
"""bool: Whether a rpmd start file is defined in the input file."""
57-
try:
58-
_ = self.rpmd_start_file
57+
if "rpmd_start_file" in self.dictionary.keys():
5958
return True
60-
except PQKeyError:
61-
return False
59+
60+
return False
6261

6362
@property
6463
def restart_file(self) -> str:

PQAnalysis/io/input_file_reader/pq/pq_input_file_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def _get_digit_string_from_filename(filename: str) -> str:
317317
if filename does not contain a number to be parsed
318318
"""
319319

320-
if (regex := re.search(r"\d+.", filename)) is None:
320+
if (regex := re.search(r"\d+\.", filename)) is None:
321321
PQInputFileReader.logger.error(
322322
(
323323
f"Filename {filename} does not contain a number to be "

examples/continue_input/run-01.in

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Type of this run
2+
jobtype = qm-md;
3+
# dim = 3d;
4+
5+
# Number of steps to be performed and timestep in fs; nreset gives the first n steps in which the total momentum is reset
6+
nstep = 20000; timestep = 2.0; nreset = 5;
7+
8+
# Time integration algorithm
9+
integrator = v-verlet;
10+
11+
# Request computation of the stress tensor
12+
# (IMPORTANT for virial calculation to the correct pressure)
13+
virial = atomic; # stress_tensor = on;
14+
15+
# Output frequency of ALL data files
16+
output_freq = 2;
17+
18+
# Generate Start velocities instead of taking them from the .rst file
19+
# init_velocities = true;
20+
21+
# Temperature algorithm (Berendsen), Target T in K and Relaxation time in ps
22+
thermostat = velocity_rescaling; temp = 298.15; t_relaxation = 0.1;
23+
24+
# Pressure coupling algorithm, Target p in bar and Relaxation time in ps
25+
# manostat = berendsen; pressure = 1.013; p_relaxation = 10.0;
26+
27+
# QM Program and QM script to run the program and parse its output
28+
qm_prog = dftbplus; qm_script = dftbplus_periodic_stress;
29+
30+
# Activate shake algorithm
31+
shake = on;
32+
33+
# Files
34+
35+
start_file = initial_mil68ga.rst;
36+
topology_file= shake.top;
37+
38+
output_file = mil68ga-md-01.out;
39+
info_file = mil68ga-md-01.info;
40+
energy_file = mil68ga-md-01.en;
41+
traj_file = mil68ga-md-01.xyz;
42+
vel_file = mil68ga-md-01.vel;
43+
charge_file = mil68ga-md-01.chrg;
44+
restart_file = mil68ga-md-01.rst;

0 commit comments

Comments
 (0)