-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fetch and store ensemble metadata in workbench (#178)
- Loading branch information
Showing
52 changed files
with
876 additions
and
494 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from typing import Sequence | ||
from fmu.sumo.explorer.explorer import CaseCollection, Case, SumoClient | ||
|
||
from ._helpers import create_sumo_client_instance | ||
|
||
|
||
class IterationInspector: | ||
""" | ||
Class for inspecting and retrieving iteration (ensemble) information | ||
""" | ||
|
||
def __init__(self, access_token: str, case_uuid: str, iteration_name: str): | ||
sumo_client: SumoClient = create_sumo_client_instance(access_token) | ||
case_collection = CaseCollection(sumo_client).filter(uuid=case_uuid) | ||
if len(case_collection) != 1: | ||
raise ValueError(f"None or multiple sumo cases found {case_uuid=}") | ||
|
||
self._case: Case = case_collection[0] | ||
self._iteration_name: str = iteration_name | ||
|
||
def get_case_name(self) -> str: | ||
"""Get name of case to which this iteration belongs""" | ||
return self._case.name | ||
|
||
def get_realizations(self) -> Sequence[int]: | ||
"""Get list of realizations for this iteration""" | ||
realizations = self._case.get_realizations(self._iteration_name) | ||
return sorted([int(real) for real in realizations]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
|
||
export type EnsembleDetails = { | ||
name: string; | ||
case_name: string; | ||
case_uuid: string; | ||
realizations: Array<number>; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.