Skip to content

Commit

Permalink
Merge pull request #27 from molssi-seamm/dev
Browse files Browse the repository at this point in the history
Bugfix: Error selecting systems by name
  • Loading branch information
seamm authored Aug 22, 2024
2 parents 09eda93 + f0ab768 commit ed9b5b0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
=======
History
=======
2024.8.21 -- Bugfix: Error selecting systems by name
* There was a bug selecting system by name in the For Systems in Database branch.

2024.8.16 -- Improved handling for For Systems in Database
* Added ability to get all configurations for each system, as well as using matching
or regexps for the names of configurations to select.
Expand Down
2 changes: 0 additions & 2 deletions loop_step/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ def run(self):
if self._loop_value is None:
self._loop_value = 0
self._loop_length = len(configurations)
print(f"{self._loop_length} configurations found.")
printer.important(
__(
f"The loop will have {self._loop_length} iterations.\n\n",
Expand Down Expand Up @@ -615,7 +614,6 @@ def run(self):
break

# Set the default system and configuration
print(f"{self._loop_value} / {self._loop_length}")
configuration = configurations[self._loop_value - 1]
system_db = configuration.system_db
system = configuration.system
Expand Down
18 changes: 14 additions & 4 deletions loop_step/tk_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,12 @@ def reset_dialog(self, widget=None):
self["start"].grid(row=row, column=3, sticky=tk.W)
self["end"].grid(row=row, column=4, sticky=tk.W)
self["step"].grid(row=row, column=5, sticky=tk.W)
row += 1
elif loop_type == "Foreach":
frame.columnconfigure(5, weight=0)
self["variable"].grid(row=row, column=2, sticky=tk.W)
self["values"].grid(row=row, column=3, sticky=tk.EW)
row += 1
frame.columnconfigure(3, weight=1)
elif loop_type == "For rows in table":
frame.columnconfigure(3, weight=0)
Expand All @@ -210,10 +212,19 @@ def reset_dialog(self, widget=None):
if "empty" not in op:
self["query-value"].grid(row=row, column=5, sticky=tk.EW)
frame.columnconfigure(5, weight=1)
row += 1
elif loop_type == "For systems in the database":
row += 1
self["criteria"].grid(row=row, column=1, columnspan=3, sticky=tk.NSEW)
frame.rowconfigure(row, weight=1, minsize=100)
# self["criteria"].grid(row=row, column=1, columnspan=3, sticky=tk.NSEW)
# frame.rowconfigure(row, weight=1, minsize=100)
# row += 1

self["where system name"].grid(
row=row, column=0, columnspan=2, sticky=tk.EW
)
choice = self["where system name"].get()
if choice != "is anything":
self["system name"].grid(row=row, column=2, columnspan=2, sticky=tk.EW)
row += 1

self["default configuration"].grid(
Expand All @@ -224,12 +235,11 @@ def reset_dialog(self, widget=None):
self["configuration name"].grid(
row=row, column=2, columnspan=2, sticky=tk.EW
)
frame.columnconfigure(3, weight=1)
row += 1
frame.columnconfigure(3, weight=1)
self["directory name"].grid(row=row, column=0, columnspan=3, sticky=tk.W)
else:
raise RuntimeError("Don't recognize the loop_type {}".format(loop_type))
row += 1
self["errors"].grid(row=row, column=0, columnspan=4, sticky=tk.W)
row += 1
frame.columnconfigure(0, minsize=40)
Expand Down

0 comments on commit ed9b5b0

Please sign in to comment.