diff --git a/semeio/workflows/correlated_observations_scaling/obs_utils.py b/semeio/workflows/correlated_observations_scaling/obs_utils.py index bfa0352a..8c94b444 100644 --- a/semeio/workflows/correlated_observations_scaling/obs_utils.py +++ b/semeio/workflows/correlated_observations_scaling/obs_utils.py @@ -2,8 +2,6 @@ from collections import namedtuple from copy import deepcopy -from ert._c_wrappers.enkf import ActiveList - from semeio.workflows.correlated_observations_scaling.exceptions import ValidationError @@ -63,24 +61,11 @@ def create_active_lists(enkf_observations, events): new_events = [] for event in events: obs_index = _data_index_to_obs_index(enkf_observations, event.key, event.index) - new_active_list = _get_active_list(obs_index) - - new_events.append(_make_tuple(event.key, event.index, new_active_list)) + new_events.append(_make_tuple(event.key, event.index, obs_index)) return new_events -def _get_active_list(index_list): - """ - If the user doesn't supply an index list, we assume ALL-ACTIVE on the - observations, otherwise an active list is - created from the index list. - """ - if index_list is None: - index_list = [] - return _active_list_from_index_list(index_list) - - def _make_tuple( key, index, @@ -90,21 +75,6 @@ def _make_tuple( return new_event(key, index, active_list) -def _active_list_from_index_list(index_list): - """ - Creates an ActiveList from a list of indexes - :param index_list: list of index - :type index_list: list - :return: Active list, a c-object with mode (ALL-ACTIVE, PARTIALLY-ACTIVE) - and list of indices - :rtype: active_list - """ - active_list = ActiveList() - for index in index_list: - active_list.addActiveIndex(index) - return active_list - - def _data_index_to_obs_index(obs, obs_key, data_index_list): if obs[obs_key].observation_type.name != "GEN_OBS": return data_index_list diff --git a/semeio/workflows/correlated_observations_scaling/update_scaling.py b/semeio/workflows/correlated_observations_scaling/update_scaling.py index 63e6b1dc..2b752dd0 100644 --- a/semeio/workflows/correlated_observations_scaling/update_scaling.py +++ b/semeio/workflows/correlated_observations_scaling/update_scaling.py @@ -35,7 +35,7 @@ def _update_scaling(obs, scale_factor, obs_list): if step - 1 in index_list: obs_node.std_scaling = scale_factor else: - obs_node.updateStdScaling(scale_factor, event.active_list) + obs_node.std_scaling[event.active_list] = scale_factor logging.info( # pylint: disable=logging-fstring-interpolation f"Keys: {[event.key for event in obs_list]} scaled " f"with scaling factor: {scale_factor}"