Skip to content

Commit

Permalink
Handle ensemble schema without parent and child ensemble_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSava committed Aug 12, 2024
1 parent 25e6e28 commit 5b8b6cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions tests/models/test_ensemble_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

def test_ensemble_model(mock_data):
ens_model = EnsembleModel(ensemble_id=1, project_id=None)
assert len(ens_model.children) == 1
assert ens_model.children[0].name == "default_smoother_update"
assert ens_model.name == "default"
assert len(ens_model.responses) == 1

Expand Down
4 changes: 2 additions & 2 deletions webviz_ert/models/ensemble_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def __init__(self, ensemble_id: str, project_id: str) -> None:
self._metadata = self._schema["userdata"]
self._name = self._metadata["name"]
self._id = ensemble_id
self._children = self._schema["child_ensemble_ids"]
self._parent = self._schema["parent_ensemble_id"]
self._children = self._schema.get("child_ensemble_ids", [])
self._parent = self._schema.get("parent_ensemble_id", [])
self._size = self._schema["size"]
self._active_realizations = self._schema["active_realizations"]
self._responses: Dict[str, Response] = {}
Expand Down

0 comments on commit 5b8b6cc

Please sign in to comment.