Skip to content

Commit

Permalink
BUG: on import, use _rmapi if _roxar is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrivenaes committed Aug 29, 2024
1 parent 69aa7dd commit 5890271
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
15 changes: 2 additions & 13 deletions src/fmu/tools/extract_grid_zone_tops.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
import pathlib
from typing import Dict, Optional, Union
from typing import Any, Dict, Optional, Union

import numpy as np
import pandas as pd
import xtgeo

try:
import _roxar # type: ignore
except ModuleNotFoundError:

class MockRoxar:
@property
def Project(self):
pass

_roxar = MockRoxar()


def extract_grid_zone_tops(
project: Optional[_roxar.Project] = None,
project: Optional[Any] = None,
well_list: Optional[list] = None,
logrun: str = "log",
trajectory: str = "Drilled trajectory",
Expand Down
5 changes: 4 additions & 1 deletion src/fmu/tools/rms/qcreset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
try:
import _roxar # type: ignore
except ModuleNotFoundError:
warnings.warn("This script only supports interactive RMS usage", UserWarning)
try:
import _rmsapi as _roxar # type: ignore
except ModuleNotFoundError:
warnings.warn("This script only supports interactive RMS usage", UserWarning)


def _set_safe_value(
Expand Down

0 comments on commit 5890271

Please sign in to comment.