Skip to content

Commit

Permalink
Remove the UI elements that show current memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-el committed Aug 16, 2024
1 parent 73b2710 commit 1336b7c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/ert/gui/model/job_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def headerData(
header = JOB_COLUMNS[section]
if header in [ids.STDOUT, ids.STDERR]:
return header.upper()
elif header in [ids.CURRENT_MEMORY_USAGE, ids.MAX_MEMORY_USAGE]:
elif header in [ids.MAX_MEMORY_USAGE]:
header = header.replace("_", " ")
return header.capitalize()
if orientation == Qt.Orientation.Vertical:
Expand Down
8 changes: 2 additions & 6 deletions src/ert/gui/model/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
DURATION, # Duration is based on two data fields, not coming directly from ert
ids.STDOUT,
ids.STDERR,
ids.CURRENT_MEMORY_USAGE,
ids.MAX_MEMORY_USAGE,
]
JOB_COLUMN_SIZE: Final[int] = len(JOB_COLUMNS)
Expand Down Expand Up @@ -383,10 +382,7 @@ def _real_data(_: QModelIndex, node: RealNode, role: int) -> Any:
if role == StatusRole:
return node.data.status
if role == MemoryUsageRole:
return (
node.data.current_memory_usage,
node.data.max_memory_usage,
)
return node.data.max_memory_usage
return QVariant()

@staticmethod
Expand Down Expand Up @@ -422,7 +418,7 @@ def _job_data(

if role == Qt.ItemDataRole.DisplayRole:
data_name = JOB_COLUMNS[index.column()]
if data_name in [ids.CURRENT_MEMORY_USAGE, ids.MAX_MEMORY_USAGE]:
if data_name in [ids.MAX_MEMORY_USAGE]:
data = node.data
_bytes: Optional[str] = data.get(data_name) # type: ignore
if _bytes:
Expand Down
7 changes: 2 additions & 5 deletions src/ert/gui/simulation/view/realization.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,9 @@ def eventFilter(self, object: Optional[QObject], event: Optional[QEvent]) -> boo
view = parent._real_view
index = view.indexAt(mouse_pos)
if index.isValid():
(current_memory_usage, maximum_memory_usage) = index.data(
MemoryUsageRole
)
if current_memory_usage and maximum_memory_usage:
maximum_memory_usage = index.data(MemoryUsageRole)
if maximum_memory_usage:
txt = (
f"Current memory usage:\t{byte_with_unit(current_memory_usage)}\n"
f"Maximum memory usage:\t{byte_with_unit(maximum_memory_usage)}"
)
QToolTip.showText(view.mapToGlobal(mouse_pos), txt)
Expand Down
11 changes: 1 addition & 10 deletions tests/unit_tests/gui/simulation/test_run_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,16 +524,7 @@ def test_run_dialog_memory_usage_showing(
assert job_model._real == 0

job_number = 0
current_memory_column_index = 6
max_memory_column_index = 7

current_memory_column_proxy_index = job_model.index(
job_number, current_memory_column_index
)
current_memory_value = job_model.data(
current_memory_column_proxy_index, Qt.DisplayRole
)
assert current_memory_value == "50.00 kB"
max_memory_column_index = 6

max_memory_column_proxy_index = job_model.index(job_number, max_memory_column_index)
max_memory_value = job_model.data(max_memory_column_proxy_index, Qt.DisplayRole)
Expand Down

0 comments on commit 1336b7c

Please sign in to comment.