Skip to content

Commit

Permalink
Rename module realization_state to realization_storage_state
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Nov 23, 2023
1 parent 0259cdf commit 16b1f0d
Show file tree
Hide file tree
Showing 24 changed files with 27 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/ert/analysis/_es_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
)

from ert.config import Field, GenKwConfig, SurfaceConfig
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState

from ..config.analysis_module import ESSettings, IESSettings
from . import misfit_preprocessor
Expand Down
2 changes: 1 addition & 1 deletion src/ert/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ert.run_arg import RunArg

from .load_status import LoadResult, LoadStatus
from .realization_state import RealizationStorageState
from .realization_storage_state import RealizationStorageState

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion src/ert/data/_measured_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import numpy as np
import pandas as pd

from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState

if TYPE_CHECKING:
import numpy.typing as npt
Expand Down
4 changes: 2 additions & 2 deletions src/ert/enkf_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .analysis.configuration import UpdateConfiguration, UpdateStep
from .config import ParameterConfig
from .job_queue import WorkflowRunner
from .realization_state import RealizationStorageState
from .realization_storage_state import RealizationStorageState
from .run_context import RunContext
from .runpaths import Runpaths
from .substitution_list import SubstitutionList
Expand Down Expand Up @@ -202,7 +202,7 @@ def sample_prior(
)
ensemble.save_parameters(parameter, realization_nr, ds)
for realization_nr in active_realizations:
ensemble.update_realization_state(
ensemble.update_realization_storage_state(
realization_nr,
[
RealizationStorageState.UNDEFINED,
Expand Down
2 changes: 1 addition & 1 deletion src/ert/gui/ertwidgets/models/ertmodel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState
from ert.storage import StorageReader


Expand Down
2 changes: 1 addition & 1 deletion src/ert/job_queue/job_queue_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from ert._clib.queue import _get_submit_attempt, _kill, _refresh_status, _submit
from ert.callbacks import forward_model_ok
from ert.load_status import LoadStatus
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState

from . import ResPrototype
from .job_status import JobStatus
Expand Down
2 changes: 1 addition & 1 deletion src/ert/libres_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
)
from ert.data import MeasuredData
from ert.data._measured_data import ObservationError, ResponseError
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState
from ert.shared.version import __version__
from ert.storage import EnsembleReader

Expand Down
9 changes: 0 additions & 9 deletions src/ert/realization_state.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/ert/run_models/ensemble_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from ert.enkf_main import sample_prior
from ert.ensemble_evaluator import EvaluatorServerConfig
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState
from ert.run_context import RunContext
from ert.storage import EnsembleAccessor, StorageAccessor

Expand Down
2 changes: 1 addition & 1 deletion src/ert/run_models/ensemble_smoother.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ert.config import ErtConfig, HookRuntime
from ert.enkf_main import sample_prior
from ert.ensemble_evaluator import EvaluatorServerConfig
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState
from ert.run_context import RunContext
from ert.run_models.run_arguments import ESRunArguments
from ert.storage import StorageAccessor
Expand Down
2 changes: 1 addition & 1 deletion src/ert/run_models/iterated_ensemble_smoother.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from ert.config import ErtConfig, HookRuntime
from ert.enkf_main import sample_prior
from ert.ensemble_evaluator import EvaluatorServerConfig
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState
from ert.run_context import RunContext
from ert.run_models.run_arguments import SIESRunArguments
from ert.storage import EnsembleAccessor, StorageAccessor
Expand Down
2 changes: 1 addition & 1 deletion src/ert/run_models/multiple_data_assimilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ert.config import ErtConfig, HookRuntime
from ert.enkf_main import sample_prior
from ert.ensemble_evaluator import EvaluatorServerConfig
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState
from ert.run_context import RunContext
from ert.run_models.run_arguments import ESMDARunArguments
from ert.storage import EnsembleAccessor, StorageAccessor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from ert import ErtScript
from ert.exceptions import StorageError
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState


class ExportMisfitDataJob(ErtScript):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from ert.gui.ertwidgets.listeditbox import ListEditBox
from ert.gui.ertwidgets.models.path_model import PathModel
from ert.gui.ertwidgets.pathchooser import PathChooser
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState


def load_args(filename, column_names=None):
Expand Down
2 changes: 1 addition & 1 deletion src/ert/simulator/simulation_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ert.config import HookRuntime
from ert.enkf_main import create_run_path
from ert.job_queue import JobQueue, JobStatus
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState
from ert.run_context import RunContext
from ert.runpaths import Runpaths

Expand Down
8 changes: 4 additions & 4 deletions src/ert/storage/local_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from ert.callbacks import forward_model_ok
from ert.load_status import LoadResult, LoadStatus
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState

if TYPE_CHECKING:
import numpy.typing as npt
Expand All @@ -35,7 +35,7 @@ def _load_realization(
realisation: int,
run_args: List[RunArg],
) -> Tuple[LoadResult, int]:
sim_fs.update_realization_state(
sim_fs.update_realization_storage_state(
realisation,
[RealizationStorageState.UNDEFINED],
RealizationStorageState.INITIALIZED,
Expand Down Expand Up @@ -270,7 +270,7 @@ def _save_state_map(self) -> None:
data = {"state_map": [v.value for v in self._state_map]}
f.write(json.dumps(data))

def update_realization_state(
def update_realization_storage_state(
self,
realization: int,
old_states: List[RealizationStorageState],
Expand Down Expand Up @@ -339,7 +339,7 @@ def save_parameters(
path.parent.mkdir(exist_ok=True)

dataset.expand_dims(realizations=[realization]).to_netcdf(path, engine="scipy")
self.update_realization_state(
self.update_realization_storage_state(
realization,
[
RealizationStorageState.UNDEFINED,
Expand Down
2 changes: 1 addition & 1 deletion src/ert/storage/local_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from pydantic import BaseModel, Field

from ert.config import ErtConfig
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState
from ert.shared import __version__
from ert.storage.local_ensemble import LocalEnsembleAccessor, LocalEnsembleReader
from ert.storage.local_experiment import LocalExperimentAccessor, LocalExperimentReader
Expand Down
2 changes: 1 addition & 1 deletion src/ert/storage/migration/block_fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
SurfaceConfig,
field_transform,
)
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState
from ert.storage import EnsembleAccessor, StorageAccessor
from ert.storage.local_storage import LocalStorageAccessor, local_storage_get_ert_config
from ert.storage.migration._block_fs_native import DataFile, Kind
Expand Down
2 changes: 1 addition & 1 deletion tests/performance_tests/test_memory_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from ert.analysis import UpdateConfiguration, smoother_update
from ert.config import ErtConfig, SummaryConfig
from ert.enkf_main import sample_prior
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState
from ert.storage import open_storage
from tests.performance_tests.performance_utils import make_poly_example

Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/analysis/test_es_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from ert.cli.main import run_cli
from ert.config import AnalysisConfig, ErtConfig, GenDataConfig, GenKwConfig
from ert.config.analysis_module import ESSettings, IESSettings
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState
from ert.storage import open_storage


Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/gui/tools/test_case_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ert.gui.tools.manage_cases.case_init_configuration import (
CaseInitializationConfigurationPanel,
)
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState


@pytest.mark.usefixtures("copy_poly_case")
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/simulator/test_simulation_context.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ert.enkf_main import EnKFMain
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState
from ert.simulator import SimulationContext
from tests.utils import wait_until

Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/status/test_tracking_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
JOB_STATE_START,
REALIZATION_STATE_FINISHED,
)
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState
from ert.shared.feature_toggling import FeatureToggling


Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/test_load_forward_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from ert.config import ErtConfig
from ert.enkf_main import create_run_path, ensemble_context
from ert.libres_facade import LibresFacade
from ert.realization_state import RealizationStorageState
from ert.realization_storage_state import RealizationStorageState
from ert.storage import open_storage


Expand Down

0 comments on commit 16b1f0d

Please sign in to comment.