Skip to content

Commit

Permalink
set fmu.context.stage to 'iteration' for aggregated data (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
adnejacobsen authored Aug 31, 2023
1 parent 43e139b commit 517c71d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fmu/dataio/dataio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,9 @@ def _generate_aggrd_metadata(
template["fmu"]["aggregation"]["realization_ids"] = real_ids
template["fmu"]["aggregation"]["id"] = self.aggregation_id

# fmu.context.stage should be 'iteration'
template["fmu"]["context"]["stage"] = "iteration"

# next, the new object will trigger update of: 'file', 'data' (some fields) and
# 'tracklog'. The trick is to create an ExportData() instance and just retrieve
# the metadata from that, and then blend the needed metadata from here into the
Expand Down
1 change: 1 addition & 0 deletions tests/test_units/test_aggregated_surfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def test_regsurf_aggregated(fmurun_w_casemetadata, aggr_surfs_mean):
newmeta = aggdata.generate_metadata(aggr_mean)
logger.debug("New metadata:\n%s", utils.prettyprint_dict(newmeta))
assert newmeta["fmu"]["aggregation"]["id"] == "1234"
assert newmeta["fmu"]["context"]["stage"] == "iteration"


def test_regsurf_aggregated_export(fmurun_w_casemetadata, aggr_surfs_mean):
Expand Down

0 comments on commit 517c71d

Please sign in to comment.