Skip to content

Commit

Permalink
Remove function only called in test
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Oct 31, 2024
1 parent 1ff1c2c commit aac8f80
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
14 changes: 0 additions & 14 deletions src/ert/simulator/batch_simulator_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,20 +256,6 @@ def results(self) -> List[Optional[Dict[str, "npt.NDArray[np.float64]"]]]:

return res

def job_status(self, iens: int) -> Optional["DeprecatedJobStatus"]:
"""Will query the queue system for the status of the job."""
state_to_legacy = {
JobState.WAITING: DeprecatedJobStatus.WAITING,
JobState.SUBMITTING: DeprecatedJobStatus.SUBMITTED,
JobState.PENDING: DeprecatedJobStatus.PENDING,
JobState.RUNNING: DeprecatedJobStatus.RUNNING,
JobState.ABORTING: DeprecatedJobStatus.DO_KILL,
JobState.COMPLETED: DeprecatedJobStatus.SUCCESS,
JobState.FAILED: DeprecatedJobStatus.FAILED,
JobState.ABORTED: DeprecatedJobStatus.IS_KILLED,
}
return state_to_legacy[self._scheduler._jobs[iens].state]

def is_job_completed(self, iens: int) -> bool:
return self.get_job_state(iens) == JobState.COMPLETED

Expand Down
8 changes: 0 additions & 8 deletions tests/ert/unit_tests/simulator/test_batch_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,6 @@ def test_batch_simulation(batch_simulator, storage):
# Asking for results before it is complete.
with pytest.raises(RuntimeError):
ctx.results()

# Ask for status of simulation we do not have.
with pytest.raises(KeyError):
ctx.job_status(1973)

with pytest.raises(KeyError):
ctx.job_progress(1987)

# Carry out simulations..
_wait_for_completion(ctx)

Expand Down
3 changes: 1 addition & 2 deletions tests/ert/unit_tests/simulator/test_simulation_context.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from ert import JobState, JobStatus
from ert import JobState
from ert.simulator import BatchContext
from tests.ert.utils import wait_until

Expand All @@ -11,7 +11,6 @@
pytest.param(
JobState.COMPLETED, JobState.FAILED, "get_job_state", id="current"
),
pytest.param(JobStatus.SUCCESS, JobStatus.FAILED, "job_status", id="legacy"),
],
)
def test_simulation_context(
Expand Down

0 comments on commit aac8f80

Please sign in to comment.