Skip to content

Commit

Permalink
Merge pull request #82 from Erastova-group/analysis_fixes
Browse files Browse the repository at this point in the history
Update siminp for d-spacing
  • Loading branch information
hp115 authored May 15, 2024
2 parents 3c52cc3 + 647e875 commit c86301a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
17 changes: 10 additions & 7 deletions package/ClayCode/core/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,13 +608,16 @@ def wrapper(self: _Args, enumerate_duplicates=False):
else:
if self.data[key].suffix != "":
self.data[key] = self.data[key].parent
path_list.extend(
[
self.data[key]
/ path.relative_to(path.cwd()),
self.data[key] / v,
]
)
try:
path_list.extend(
[
self.data[key]
/ path.relative_to(path.cwd()),
self.data[key] / v,
]
)
except ValueError:
path_list.extend([self.data[key] / v])
for path_option in path_list:
try:
path_option = File(path_option, check=True)
Expand Down
5 changes: 3 additions & 2 deletions package/ClayCode/data/data/MDP/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ NVT:
tcoupl: "nose-hoover"
constraints: "h-bonds"
constraint-algorithm: "lincs"
D-SPACE:
D_SPACE:
dt: "0.001"
integrator: "md"
tinit: "0"
Expand All @@ -948,7 +948,7 @@ D-SPACE:
tau-p: "1.0"
tau-t: "0.2"
tc-grps: "system"
tcoupl: "nose-hoover"
tcoupl: "berendsen"
EM:
constraints: "none"
emstep: "0.0005"
Expand Down Expand Up @@ -1149,3 +1149,4 @@ GENION:
wall-ewald-zfac: ""
wall-r-linpot: ""
wall-type: ""
constraint_algorithm: ""
8 changes: 4 additions & 4 deletions package/ClayCode/siminp/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ def get_run_path(self, filename: PathOrStr):
out_part = self.odir
relpath = list(out_part.parts)[-1]
new_rdir = []
for rd in self.run_path.parts[1:]:
for rd in self.run_path.parts:
if rd not in out_part.parts:
new_rdir.append(rd)
else:
relpath = Path(*out_part.parts[out_part.parts.index(rd) :])
break
if len(new_rdir) != 0:
new_rdir.insert(0, "/")
# if len(new_rdir) != 0:
# new_rdir.insert(0, "/")
new_rdir = Path(*new_rdir, relpath)
return new_rdir / rel_filename
else:
Expand Down Expand Up @@ -794,7 +794,6 @@ def get_run_command(self, gmx_alias="gmx", max_run=10, mdrun_prms=None):
mdrun_prms_str = "".join(
[f" -{k} {v}" for k, v in mdrun_prms.items()]
)
mdrun_prms_str
with open(DSPACE_RUN_SCRIPT, "r") as dspace_run_file:
dspace_run_string = dspace_run_file.read()
dspace_run_string = substitute_kwds(
Expand Down Expand Up @@ -1092,6 +1091,7 @@ def write_runs(
mdrun_prms: Optional[Union[MDPFile, File, str]] = None,
shell: Optional[str] = None,
header: Optional[str] = None,
gmx_version: Optional[int] = None,
**kwargs,
):
"""Write the run script for the run sequence.
Expand Down

0 comments on commit c86301a

Please sign in to comment.