Skip to content

Commit

Permalink
fixed ad4 parameter file
Browse files Browse the repository at this point in the history
  • Loading branch information
lmdu committed Sep 15, 2023
1 parent 2578f9e commit e04ebc6
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

DOCKEY_VERSION = "0.9.0"

DOCKEY_BUILD = "230830"
DOCKEY_BUILD = "230915"

DOCKEY_ABOUT = """
<p>Dockey - Molecular Docking and Virtual Screening</p>
Expand Down
10 changes: 9 additions & 1 deletion src/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def __init__(self):
type = str,
default = '',
value = '',
comment = 'Parameter library filename',
comment = 'Parameter library file',
scope = 'global',
required = False,
user = True
Expand Down Expand Up @@ -788,6 +788,14 @@ def make_dpf_file(self, receptor_file, ligand_file, flex=False):
for m in v.value:
rows.append("map {}".format(m))

if k == 'parameter_file':
if os.path.isfile(v):
plf = os.path.join(os.path.dirname(receptor_file), "param_library.dat")
with open(v) as fh, open(plf, 'w') as fw:
fw.write(fh.read())

rows.append("parameter_file param_library.dat")

elif v.type in (int, str):
rows.append("{} {}".format(k, v.value))

Expand Down
41 changes: 28 additions & 13 deletions src/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1864,20 +1864,35 @@ def sizeHint(self):
@Slot()
def update_resource_usage(self):
process_count = 1
cpu_percent = self.proc.cpu_percent(interval=0.1)
memory_size = self.proc.memory_info().rss
memory_percent = self.proc.memory_percent()

for child in self.proc.children(recursive=True):
process_count += 1
cpu_percent += child.cpu_percent(interval=0.1)
memory_size += child.memory_info().rss
memory_percent += child.memory_percent()

self.cpu_usage.setValue(int(cpu_percent/psutil.cpu_count(False)))
cpu_percent = 0
memory_size = 0
memory_percent = 0

try:
with self.proc.oneshot():
cpu_percent = self.proc.cpu_percent(interval=0.1)
memory_size = self.proc.memory_info().rss
memory_percent = self.proc.memory_percent()
except psutil.NoSuchProcess:
pass

try:
children = self.proc.children(recursive=True)
except psutil.NoSuchProcess:
children = []

for child in children:
try:
with child.oneshot():
process_count += 1
cpu_percent += child.cpu_percent(interval=0.1)
memory_size += child.memory_info().rss
memory_percent += child.memory_percent()
except psutil.NoSuchProcess:
pass

self.cpu_usage.setValue(int(cpu_percent/psutil.cpu_count()))
self.memory_usage.setValue(int(memory_percent))
self.memory_text.setText("Memory: {} \t Running processes: {}".format(
memory_format(memory_size), process_count
))


3 changes: 2 additions & 1 deletion src/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ def create_actions(self):
self.pymol_cmd_act.setChecked(False)
self.pymol_cmd_act.setIconVisibleInMenu(False)

self.check_cpu_act = QAction(QIcon(':/icons/cpu.svg'), "View CPU Consumption", self)
self.check_cpu_act = QAction(QIcon(':/icons/cpu.svg'), "CPU and Memory Usage", self)
self.check_cpu_act.setIconVisibleInMenu(False)
self.check_cpu_act.triggered.connect(self.view_cpu_consumption)

Expand Down Expand Up @@ -701,6 +701,7 @@ def create_menus(self):

self.task_menu = self.menuBar().addMenu("&Task")
self.task_menu.addAction(self.task_act)
self.task_menu.addAction(self.check_cpu_act)

self.pymol_menu = self.menuBar().addMenu("&PyMOL")

Expand Down

0 comments on commit e04ebc6

Please sign in to comment.