Skip to content
Merged
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/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ def is_within_directory(directory, target):
prefix = os.path.commonprefix([abs_directory, abs_target])
return prefix == abs_directory

def safe_extract(tar, path=".", members=None, *, numeric_owner=False):
def safe_extract(tar, path=".", members=None, numeric_owner=False):
for member in tar.getmembers():
member_path = os.path.join(path, member.name)
if not is_within_directory(path, member_path):
Expand Down
8 changes: 4 additions & 4 deletions src/tinkerio.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ def evaluate_(self, xyzin, force=False, dipole=False):
Result = OrderedDict()
# If we want the dipoles (or just energies), analyze is the way to go.
if dipole or (not force):
oanl = self.calltinker("analyze %s -k %s" % (xyzin, self.name), stdin="G,E,M", print_to_screen=False)
oanl = self.calltinker("analyze %s -k %s" % (xyzin, self.name), stdin="G E M", print_to_screen=False)
# Read potential energy and dipole from file.
eanl = []
dip = []
Expand Down Expand Up @@ -986,7 +986,7 @@ def molecular_dynamics(self, nsteps, timestep, temperature=None, pressure=None,
temps = np.array(temps)

if verbose: logger.info("Post-processing to get the dipole moments\n")
oanl = self.calltinker("analyze %s-md.arc" % self.name, stdin="G,E,M", print_to_screen=False)
oanl = self.calltinker("analyze %s-md.arc" % self.name, stdin="G E M", print_to_screen=False)

# Read potential energy and dipole from file.
eanl = []
Expand All @@ -1006,7 +1006,7 @@ def molecular_dynamics(self, nsteps, timestep, temperature=None, pressure=None,
dip.append([float(s[i]) for i in range(-3,0)])
if first_shot:
for key in eckeys:
if strip.startswith(key):
if strip.startswith(key) and isfloat(s[-2]):
if key in ecomp:
ecomp[key].append(float(s[-2])*4.184)
else:
Expand All @@ -1016,7 +1016,7 @@ def molecular_dynamics(self, nsteps, timestep, temperature=None, pressure=None,
havekeys.add(key)
else:
for key in havekeys:
if strip.startswith(key):
if strip.startswith(key) and isfloat(s[-2]):
if key in ecomp:
ecomp[key].append(float(s[-2])*4.184)
else:
Expand Down
8 changes: 4 additions & 4 deletions tools/drawforces/drawforces.vmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ proc min {x y} {expr {$x<$y? $x: $y}}
# lot of vectors easily.
# field has to be a list of pairs of xyz triples (center and vector).
# the function returns a list of the graphics ids for easy deletion.
proc vmd_draw_vector {mol cnt vec {scale 1.0} {res 35} {radius 0.05}} {
proc vmd_draw_vector {mol cnt vec {scale 1.0} {res 35} {radius 0.1}} {
global cid

set camz [lindex [lindex [molinfo 0 get view_matrix] 0] 2]
Expand All @@ -81,7 +81,7 @@ proc vmd_draw_vector {mol cnt vec {scale 1.0} {res 35} {radius 0.05}} {
# Choose a direction that is normal to the present vector.
set offset [ vecscale $x3 [expr [expr $cid - 0.5] * 0.05] ]
set cnt [ vecadd $cnt $offset ]
set radius [min [expr 0.1 * [veclength $vec]] $radius]
set radius [min [expr 0.3 * [veclength $vec]] $radius]
return [list \
[graphics $mol cylinder [vecsub $cnt $veczero] \
[vecadd $cnt [vecscale 0.8 $vecfull]] \
Expand All @@ -91,7 +91,7 @@ proc vmd_draw_vector {mol cnt vec {scale 1.0} {res 35} {radius 0.05}} {
resolution $res]]
}

proc vmd_draw_vecfield {mol field {scale 1.0} {res 35} {radius 0.05}} {
proc vmd_draw_vecfield {mol field {scale 1.0} {res 35} {radius 0.1}} {
set gids ""
foreach i $field {
lassign $i cnt vec
Expand Down Expand Up @@ -121,7 +121,7 @@ proc do_frcdraw {args} {
set cid 0
foreach frcdata $frcdatas($frame) {
graphics $molid color [ lindex $colors $cid ]
lappend frcgraphs [vmd_draw_vecfield $molid $frcdata 3.0 35 1.2]
lappend frcgraphs [vmd_draw_vecfield $molid $frcdata 3.0 35 0.1]
incr cid
}
}
Expand Down
Loading