Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements in opening flowcharts #176

Merged
merged 1 commit into from
Oct 20, 2024
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
9 changes: 9 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
=======
History
=======
2024.10.20 -- Improvements in opening flowcharts
* Removed directories and files not ending in ".flow" from the list of flowcharts
that can be opened.
* When getting a flowchart from a previous job, the list of jobs is reversed so
the most recent is at the top.
* Enhanced the handling of parameters to support e.g. lists of values with the
normal units attached. Used in e.g. thermochemistry to allow lists of temperatures
and pressures with associated units.

2024.10.13 -- Bugfix: Issue changing units for some parameters
* Fixed a problem converting e.g. E_h to kJ/mol in the GUI widgets. The problem
occurred whenever the conversion was not direct but involved different
Expand Down
6 changes: 5 additions & 1 deletion seamm/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,11 @@ def get(self, context=None, formatted=False, units=True):

# and run into pint quantity if requested
if units and self.units is not None and self.units != "":
result = Q_(result, self.units)
# Might be a string...
if isinstance(result, str):
result = (result, self.units)
else:
result = Q_(result, self.units)

return result

Expand Down
4 changes: 2 additions & 2 deletions seamm/tk_open.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def fill_tree(self, job_list):
self.clear_tree()
self._data = {}
tree = self["tree"]
for job in job_list:
for job in job_list[::-1]:
iid = tree.insert("", "end", text=f"Job_{job['id']:0>6d}: {job['title']}")
self._data[iid] = job

Expand Down Expand Up @@ -375,7 +375,7 @@ def open_node(self, event=None):
if path is not None:
tree.delete(*tree.get_children(node))
for p in sorted(path.iterdir(), key=lambda p: p.name):
if p.is_dir() or p.suffix == ".flow":
if p.suffix == ".flow":
self.insert_node(node, p.name, p)

def reset_dialog(self, event=None):
Expand Down
Loading