Conversation
There was a problem hiding this comment.
Pull request overview
Updates the “Manage Experiments” GUI to make the experiment list clearer and more interactive, including a more discoverable add button, sortable columns, and showing an experiment creation timestamp in the detail panel.
Changes:
- Renames the main tab to “Experiments Overview” and updates the “Add new experiment” button to a text button.
- Enables column sorting in the experiments tree view (via a proxy model and
UserRolesort keys). - Adds a “Created at” field to the experiment detail view, derived from ensemble start times.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/ert/gui/tools/manage_experiments/storage_widget.py |
Switches add button to QPushButton and enables sortable/filterable tree view with a custom sorting proxy. |
src/ert/gui/tools/manage_experiments/storage_model.py |
Renames the time column header and adds UserRole data for stable sorting (name + timestamp). |
src/ert/gui/tools/manage_experiments/storage_info_widget.py |
Displays an experiment “Created at” timestamp in the experiment detail panel. |
src/ert/gui/tools/manage_experiments/manage_experiments_panel.py |
Renames the first tab label to “Experiments Overview”. |
| elif role == Qt.ItemDataRole.UserRole: | ||
| if col == _Column.NAME: | ||
| return self._name | ||
| if col == _Column.TIME: | ||
| return self._children[0]._start_time if self._children else None |
There was a problem hiding this comment.
ExperimentModel uses self._children[0]._start_time as the value for the "Created" column when sorting (UserRole). Since LocalStorage._load_ensembles() inserts ensembles sorted by started_at descending, index 0 corresponds to the newest ensemble, not the experiment’s creation time. This makes the "Created" column (and sorting by it) misleading and inconsistent with the experiment details view which uses the earliest ensemble time. Consider computing the earliest (or otherwise explicitly defined) timestamp across all child ensembles for both DisplayRole and UserRole so the semantics match the column header.
| try: | ||
| ensemble_start_times = [ens.started_at for ens in experiment.ensembles] | ||
| if ensemble_start_times: | ||
| created_text = min(ensemble_start_times).strftime("%Y-%m-%d %H:%M:%S") | ||
| except Exception: | ||
| created_text = "Unknown" |
There was a problem hiding this comment.
setExperiment() wraps the created-at computation in a broad except Exception, which can silently hide real bugs (e.g., storage access problems) and make UI issues hard to diagnose. Since started_at appears to be a datetime, this can be handled without a blanket exception by filtering/handling empty iterables explicitly (e.g., compute min with a default, or guard on an empty list) and only catching the specific exceptions you expect.
| try: | |
| ensemble_start_times = [ens.started_at for ens in experiment.ensembles] | |
| if ensemble_start_times: | |
| created_text = min(ensemble_start_times).strftime("%Y-%m-%d %H:%M:%S") | |
| except Exception: | |
| created_text = "Unknown" | |
| ensemble_start_times = [ | |
| ens.started_at | |
| for ens in experiment.ensembles | |
| if ens.started_at is not None | |
| ] | |
| if ensemble_start_times: | |
| created_text = min(ensemble_start_times).strftime("%Y-%m-%d %H:%M:%S") |
| proxy_model.setSortRole(Qt.ItemDataRole.UserRole) | ||
| proxy_model.setFilterCaseSensitivity(Qt.CaseSensitivity.CaseInsensitive) | ||
| proxy_model.setDynamicSortFilter(True) | ||
| proxy_model.sort(0, Qt.SortOrder.AscendingOrder) | ||
|
|
||
| self._tree_view.setModel(proxy_model) | ||
| self._tree_view.setSortingEnabled(True) | ||
| header = self._tree_view.header() | ||
| header.setSortIndicatorShown(True) |
There was a problem hiding this comment.
Sorting via clickable headers is new behavior (setSortingEnabled(True) + setSortRole(UserRole) + custom lessThan). There are existing GUI tests for the Manage Experiments tool, but none appear to assert that clicking the header actually reorders items correctly (including the numeric realization ordering and created-time ordering). Please add a UI test that clicks the header sections and verifies the resulting order so this feature doesn’t regress.
b36f57a to
4ce918f
Compare
❌ 2 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
4ce918f to
f027f48
Compare
Issue
Resolves #12660
Approach
Changes to the GUI:
AFTER:

BEFORE:

git rebase -i main --exec 'just rapid-tests')When applicable