Skip to content
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

Convert to res2df #26

Merged
merged 20 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Makes reservoir simulator (Eclipse, [OPM](https://opm-project.org/)) results ava

Uploads files from reservoir simulators to azure assisted by Sumo. This is done in a three step process.

1. Data is extracted in arrow format using [ecl2df](https://github.com/equinor/ecl2df).
1. Data is extracted in arrow format using [res2df](https://github.com/equinor/res2df).
2. Corresponding metadata is generated via [fmu-dataio](https://github.com/equinor/fmu-dataio).
3. Data and metadata is then uploaded to Sumo using [fmu-sumo-uploader](https://github.com/equinor/fmu-sumo-uploader).

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=65.0", "setuptools-scm>=7.0"]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
Expand All @@ -19,7 +19,7 @@ dependencies = [
"fmu-sumo-uploader @ git+https://github.com/equinor/fmu-sumo-uploader.git@main",
"fmu-dataio",
"opm<=2022.4,>=2020.10.2",
"ecl2df",
"res2df",
"pandas<2.0",
"arrow",
]
Expand Down
14 changes: 7 additions & 7 deletions src/fmu/sumo/sim2sumo/_special_treatments.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Special treatment of some options used in ecl2df"""
"""Special treatment of some options used in res2df"""
from inspect import signature
import importlib
import logging
from pathlib import Path
import ecl2df
from ecl2df.common import convert_lyrlist_to_zonemap, parse_lyrfile
import res2df
from res2df.common import convert_lyrlist_to_zonemap, parse_lyrfile
import pandas as pd
import pyarrow as pa

Expand Down Expand Up @@ -68,7 +68,7 @@ def find_functions_and_docstring(submod):
"""
logger = logging.getLogger(__file__ + ".find_func_and_info")

import_path = "ecl2df." + submod
import_path = "res2df." + submod
func = importlib.import_module(import_path).df
logger.debug("Assigning %s to %s", func.__name__, submod)
returns = {
Expand All @@ -93,7 +93,7 @@ def _define_submodules():
"""

logger = logging.getLogger(__file__ + "define_submodules")
package_path = Path(ecl2df.__file__).parent
package_path = Path(res2df.__file__).parent

submodules = {}
submod_paths = list(package_path.glob("*.py"))
Expand Down Expand Up @@ -135,12 +135,12 @@ def convert_options(options):


def tidy(frame):
"""Utility function to tidy up mess from ecl2df for rft
"""Utility function to tidy up mess from res2df for rft

Args:
frame (pd.DataFrame): the dataframe fixed with no WELLETC
"""
# Ecl2df creates three files for rft data, see unwanted list below
# res2df creates three files for rft data, see unwanted list below
logger = logging.getLogger(__file__ + ".tidy")
unwanteds = ["seg.csv", "con.csv", "icd.csv"]
cwd = Path().cwd()
Expand Down
4 changes: 2 additions & 2 deletions src/fmu/sumo/sim2sumo/sim2sumo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import logging
import argparse
import pandas as pd
import ecl2df as sim2df
import res2df
import pyarrow as pa
import yaml
from fmu.dataio import ExportData
Expand Down Expand Up @@ -83,7 +83,7 @@ def get_results(
logger.debug("Exporting with arguments %s", right_kwargs)
try:
output = extract_df(
sim2df.EclFiles(datafile_path),
res2df.ResdataFiles(datafile_path),
**convert_options(right_kwargs),
)
if submod == "rft":
Expand Down