Skip to content

Commit

Permalink
FIX: add experimental decorator on export_volumetrics()
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrivenaes authored and ErichSuter committed Sep 26, 2024
1 parent 17cabe2 commit 71d9bb3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/fmu/dataio/export/_decorators.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import warnings
from functools import wraps


def experimental(func): # type: ignore
"""Decorator to mark functions as experimental."""

@wraps(func)
def wrapper(*args, **kwargs): # type: ignore
warnings.warn(
f"{func.__name__} is experimental and may change in future versions.",
UserWarning,
stacklevel=2,
)
return func(*args, **kwargs)

return wrapper
5 changes: 5 additions & 0 deletions src/fmu/dataio/export/rms/volumetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from fmu.config.utilities import yaml_load
from fmu.dataio._logging import null_logger

from .._decorators import experimental
from ._conditional_rms_imports import import_rms_package

_modules = import_rms_package()
Expand Down Expand Up @@ -192,6 +193,7 @@ def export(self) -> dict[str, str]:
return self._export_volume_table()


@experimental
def export_volumetrics(
project: Any,
grid_name: str,
Expand Down Expand Up @@ -229,6 +231,9 @@ def export_volumetrics(
classification: Optional. Use 'internal' or 'restricted' (default).
workflow: Optional. Information about the work flow; defaulted to
'rms volumetrics'.
Note:
This function is experimental and may change in future versions.
"""

return _ExportVolumetricsRMS(
Expand Down

0 comments on commit 71d9bb3

Please sign in to comment.