Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/ert/storage/local_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,11 @@ def get_observations_and_responses(
on=["response_key", *response_cls.primary_key],
)

# Do not drop primary keys which
# overlap with localization attributes
primary_keys_to_drop = set(response_cls.primary_key).difference(
{"north", "east", "radius"}
)
joined = (
joined.with_columns(
pl.concat_str(
Expand All @@ -1131,7 +1136,7 @@ def get_observations_and_responses(
# Avoid potential collisions w/ primary key
)
)
.drop(response_cls.primary_key)
.drop(primary_keys_to_drop)
.rename({"__tmp_index_key__": "index"})
)

Expand All @@ -1147,6 +1152,9 @@ def get_observations_and_responses(
"observation_key",
"observations",
"std",
"east",
"north",
"radius",
]
)

Expand Down
3 changes: 3 additions & 0 deletions tests/ert/performance_tests/test_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ def g(X):
"index": np.arange(len(observations)),
"observations": observations,
"std": observation_noise,
"east": pl.Series([None] * len(observations), dtype=pl.Float32),
"north": pl.Series([None] * len(observations), dtype=pl.Float32),
"radius": pl.Series([None] * len(observations), dtype=pl.Float32),
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ def create_experiment_args(
rng.normal(loc=0.2, scale=0.1, size=num_gen_data_obs),
dtype=pl.Float32,
),
"east": pl.Series([None] * num_gen_data_obs, dtype=pl.Float32),
"north": pl.Series([None] * num_gen_data_obs, dtype=pl.Float32),
"radius": pl.Series([None] * num_gen_data_obs, dtype=pl.Float32),
}
)

Expand Down Expand Up @@ -195,6 +198,9 @@ def create_experiment_args(
rng.normal(loc=0.2, scale=0.1, size=num_summary_obs),
dtype=pl.Float32,
),
"east": pl.Series([None] * num_summary_obs, dtype=pl.Float32),
"north": pl.Series([None] * num_summary_obs, dtype=pl.Float32),
"radius": pl.Series([None] * num_summary_obs, dtype=pl.Float32),
}
)

Expand Down
12 changes: 12 additions & 0 deletions tests/ert/unit_tests/analysis/test_es_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ def obs() -> pl.DataFrame:
"index": pl.Series([0, 1, 2], dtype=pl.UInt16),
"observations": pl.Series([1.0, 1.0, 1.0], dtype=pl.Float32),
"std": pl.Series([0.1, 1.0, 10.0], dtype=pl.Float32),
"east": pl.Series([None, None, None], dtype=pl.Float32),
"north": pl.Series([None, None, None], dtype=pl.Float32),
"radius": pl.Series([None, None, None], dtype=pl.Float32),
}
)

Expand Down Expand Up @@ -250,6 +253,9 @@ def test_update_handles_precision_loss_in_std_dev(tmp_path):
[559437122.6211826, 999999999.9999999, 1.9],
dtype=pl.Float32,
),
"east": pl.Series([None, None, None], dtype=pl.Float32),
"north": pl.Series([None, None, None], dtype=pl.Float32),
"radius": pl.Series([None, None, None], dtype=pl.Float32),
}
)
},
Expand Down Expand Up @@ -364,6 +370,9 @@ def test_update_raises_on_singular_matrix(tmp_path):
[0.33333334, 0.14142136, 0.0],
dtype=pl.Float32,
),
"east": pl.Series([None, None, None], dtype=pl.Float32),
"north": pl.Series([None, None, None], dtype=pl.Float32),
"radius": pl.Series([None, None, None], dtype=pl.Float32),
}
)
},
Expand Down Expand Up @@ -940,6 +949,9 @@ def test_gen_data_obs_data_mismatch(storage, uniform_parameter):
"index": pl.Series([1000], dtype=pl.UInt16),
"observations": pl.Series([1.0], dtype=pl.Float32),
"std": pl.Series([0.1], dtype=pl.Float32),
"east": pl.Series([None], dtype=pl.Float32),
"north": pl.Series([None], dtype=pl.Float32),
"radius": pl.Series([None], dtype=pl.Float32),
}
)

Expand Down
3 changes: 3 additions & 0 deletions tests/ert/unit_tests/storage/test_local_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,9 @@ def test_asof_joining_summary(tmp_path, perturb_observations, perturb_responses)
[0.1] * len(response_keys),
dtype=pl.Float32,
),
"north": pl.Series([None] * len(response_keys), dtype=pl.Float32),
"east": pl.Series([None] * len(response_keys), dtype=pl.Float32),
"radius": pl.Series([None] * len(response_keys), dtype=pl.Float32),
}
)

Expand Down
Loading