Skip to content

Commit

Permalink
Set initial state in gui for forward model steps
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Jan 24, 2025
1 parent 02df6ee commit bdc8bf9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ert/ensemble_evaluator/_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
ENSEMBLE_STATE_STARTED,
ENSEMBLE_STATE_STOPPED,
ENSEMBLE_STATE_UNKNOWN,
FORWARD_MODEL_STATE_START,
FORWARD_MODEL_STATE_INIT,
REALIZATION_STATE_WAITING,
)

Expand Down Expand Up @@ -126,7 +126,7 @@ def _create_snapshot(self) -> EnsembleSnapshot:
)
for index, fm_step in enumerate(real.fm_steps):
realization["fm_steps"][str(index)] = FMStepSnapshot(
status=FORWARD_MODEL_STATE_START,
status=FORWARD_MODEL_STATE_INIT,
index=str(index),
name=fm_step.name,
)
Expand Down
6 changes: 4 additions & 2 deletions src/ert/ensemble_evaluator/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
REALIZATION_STATE_UNKNOWN,
)

FORWARD_MODEL_STATE_START: Final = "Pending"
FORWARD_MODEL_STATE_INIT: Final = "Pending"
FORWARD_MODEL_STATE_START: Final = "Running"
FORWARD_MODEL_STATE_RUNNING: Final = "Running"
FORWARD_MODEL_STATE_FINISHED: Final = "Finished"
FORWARD_MODEL_STATE_FAILURE: Final = "Failed"
Expand All @@ -46,7 +47,8 @@
}

FORWARD_MODEL_STATE_TO_COLOR: Final = {
str(FORWARD_MODEL_STATE_START): COLOR_PENDING,
str(FORWARD_MODEL_STATE_INIT): COLOR_PENDING,
str(FORWARD_MODEL_STATE_START): COLOR_RUNNING,
str(FORWARD_MODEL_STATE_RUNNING): COLOR_RUNNING,
str(FORWARD_MODEL_STATE_FINISHED): COLOR_FINISHED,
str(FORWARD_MODEL_STATE_FAILURE): COLOR_FAILED,
Expand Down
2 changes: 1 addition & 1 deletion tests/ert/unit_tests/gui/model/test_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_snapshot_model_data_intact_on_full_update(full_snapshot, fail_snapshot)
model._add_snapshot(SnapshotModel.prerender(full_snapshot), "0")

first_real = model.index(0, 0, model.index(0, 0))
assert first_real.internalPointer().children["0"].data["status"] == "Pending"
assert first_real.internalPointer().children["0"].data["status"] == "Running"
# Update with a different snapshot, -- data should change accordingly
model._add_snapshot(SnapshotModel.prerender(fail_snapshot), "0")
first_real = model.index(0, 0, model.index(0, 0))
Expand Down

0 comments on commit bdc8bf9

Please sign in to comment.