-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support latest sumo metadata #434
Support latest sumo metadata #434
Conversation
HansKallekleiv
commented
Oct 22, 2023
•
edited
Loading
edited
- Use new Sumo parameter table collection for retrieving parameters
- Use new metadata definition for Sumo Summary data
- Handle surfaces with missing metadata
- Set default sumo environment to production
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of comments - otherwise LGTM.
|
||
sensitivities = create_ensemble_sensitivities(sumo_parameters) | ||
parameters = [create_ensemble_parameter(sumo_parameter) for sumo_parameter in sumo_parameters] | ||
table = table_collection[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
table = table_collection[0] | |
table = await table_collection.getitem_async(0) |
sensitivities = create_ensemble_sensitivities(sumo_parameters) | ||
parameters = [create_ensemble_parameter(sumo_parameter) for sumo_parameter in sumo_parameters] | ||
table = table_collection[0] | ||
byte_stream: BytesIO = table.blob |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be async in some way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a table.blob_async which do return a BytesIO object, but the following lines:
table = await table_collection.getitem_async(0)
byte_stream: BytesIO = await table.blob_async
table = pq.read_table(byte_stream)
gives: pyarrow.lib.ArrowInvalid: Could not open Parquet input source '<Buffer>': Parquet magic bytes not found in footer. Either the file is corrupted or this is not a parquet file.
Not entirely sure why...
def get_smry_table_collection(case: Case, iteration_name: str, column_name: Optional[str] = None) -> TableCollection: | ||
"""Get a collection of summary tables for a case and iteration""" | ||
all_smry_table_collections = case.tables.filter( | ||
aggregation="collection", | ||
tagname="summary", | ||
iteration=iteration_name, | ||
column=column_name, | ||
) | ||
table_names = all_smry_table_collections.names | ||
if len(table_names) == 0: | ||
raise ValueError("No summary table collections found") | ||
if len(table_names) == 1: | ||
return all_smry_table_collections | ||
|
||
raise ValueError(f"Multiple summary table collections found: {table_names}. Expected only one.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this function also be async, and use async/await on its calls to sumo?
6cf2728
to
c6305a6
Compare