diff --git a/docs/src/rms_oneliners.rst b/docs/src/rms_oneliners.rst index f969c792a..cc61ade91 100644 --- a/docs/src/rms_oneliners.rst +++ b/docs/src/rms_oneliners.rst @@ -18,11 +18,11 @@ Example: .. code-block:: python - from fmu.dataio.export.rms import export_rms_volumetrics + from fmu.dataio.export.rms import export_volumetrics ... # here 'Geogrid' is the grid model name, and 'geogrid_volumes' is the name of the volume job - outfiles = export_rms_volumetrics(project, "Geogrid", "geogrid_volumes") + outfiles = export_volumetrics(project, "Geogrid", "geogrid_volumes") print(f"Output volumes to {outfiles}") @@ -30,7 +30,7 @@ Most ``dataio`` settings are here defaulted, but some keys can be altered option .. code-block:: python - outfiles = export_rms_volumetrics( + outfiles = export_volumetrics( project, "Geogrid", "geogrid_volumes", diff --git a/src/fmu/dataio/export/rms/__init__.py b/src/fmu/dataio/export/rms/__init__.py index 5fcbf3b16..7ee29e580 100644 --- a/src/fmu/dataio/export/rms/__init__.py +++ b/src/fmu/dataio/export/rms/__init__.py @@ -1,3 +1,3 @@ -from .volumetrics import export_rms_volumetrics +from .volumetrics import export_rms_volumetrics, export_volumetrics -__all__ = ["export_rms_volumetrics"] +__all__ = ["export_volumetrics", "export_rms_volumetrics"] diff --git a/src/fmu/dataio/export/rms/volumetrics.py b/src/fmu/dataio/export/rms/volumetrics.py index da81aa427..22e5ca81f 100644 --- a/src/fmu/dataio/export/rms/volumetrics.py +++ b/src/fmu/dataio/export/rms/volumetrics.py @@ -1,5 +1,6 @@ from __future__ import annotations +import warnings from dataclasses import dataclass, field from pathlib import Path from typing import Any, Final @@ -191,7 +192,7 @@ def export(self) -> dict[str, str]: return self._export_volume_table() -def export_rms_volumetrics( +def export_volumetrics( project: Any, grid_name: str, volume_job_name: str, @@ -242,3 +243,16 @@ def export_rms_volumetrics( classification=classification, workflow=workflow, ).export() + + +# keep the old name for now but not log (will be removed soon as we expect close to +# zero usage so far) +def export_rms_volumetrics(*args, **kwargs) -> dict[str, str]: # type: ignore + """Deprecated function. Use export_volumetrics instead.""" + warnings.warn( + "export_rms_volumetrics is deprecated and will be removed in a future release. " + "Use export_volumetrics instead.", + FutureWarning, + stacklevel=2, + ) + return export_volumetrics(*args, **kwargs) diff --git a/tests/test_export_rms/test_export_rms_volumetrics.py b/tests/test_export_rms/test_export_rms_volumetrics.py index 20fd40746..882d1614f 100644 --- a/tests/test_export_rms/test_export_rms_volumetrics.py +++ b/tests/test_export_rms/test_export_rms_volumetrics.py @@ -60,11 +60,11 @@ def test_rms_volumetrics_export_function( ): """Test the public function.""" - from fmu.dataio.export.rms import export_rms_volumetrics + from fmu.dataio.export.rms import export_volumetrics os.chdir(rmssetup_with_fmuconfig) - result = export_rms_volumetrics(mock_project_variable, "Geogrid", "geogrid_volume") + result = export_volumetrics(mock_project_variable, "Geogrid", "geogrid_volume") vol_table_file = result["volume_table"] assert Path(vol_table_file).is_file()