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

OpenVDS not supported on python 3.12 #307

Merged
merged 1 commit into from
Mar 23, 2024
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 .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies = [
"sumo-wrapper-python",
"xtgeo",
"pyarrow; python_version > '3.6.1'",
"OpenVDS; sys_platform != 'darwin'",
"OpenVDS; sys_platform != 'darwin' and python_version < '3.12'",
]

[project.urls]
Expand Down
9 changes: 3 additions & 6 deletions src/fmu/sumo/explorer/objects/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@
import sys
import warnings

if sys.platform == "darwin":
try:
import openvds
except ImportError:
warnings.warn("OpenVDS is missing. Some Cube methods will not work.")
else:
try:
import openvds
except ImportError:
warnings.warn("OpenVDS is missing. Some Cube methods will not work.")


class Cube(Child):
Expand Down
20 changes: 15 additions & 5 deletions tests/test_explorer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"""Tests explorer"""

from platform import python_version
import sys
if not sys.platform.startswith('darwin'):

if not sys.platform.startswith("darwin") and sys.version_info < (3, 12):
import openvds
import logging
import json
Expand Down Expand Up @@ -41,11 +44,13 @@ def fixture_case_uuid() -> str:
"""Returns case uuid"""
return "2c2f47cf-c7ab-4112-87f9-b4797ec51cb6"


@pytest.fixture(name="seismic_case_uuid")
def fixture_seismic_case_uuid() -> str:
"""Returns seismic case uuid"""
return "c616019d-d344-4094-b2ee-dd4d6d336217"


@pytest.fixture(name="explorer")
def fixture_explorer(token: str) -> Explorer:
"""Returns explorer"""
Expand Down Expand Up @@ -269,7 +274,11 @@ def test_get_case_by_uuid(explorer: Explorer, case_uuid: str, case_name: str):
assert case.uuid == case_uuid
assert case.name == case_name

@pytest.mark.skipif(sys.platform.startswith('darwin'), reason="do not run OpenVDS SEGYImport on mac os")

@pytest.mark.skipif(
sys.platform.startswith("darwin") or sys.version_info > (3, 11),
reason="do not run OpenVDS SEGYImport on mac os or python 3.12",
)
def test_seismic_case_by_uuid(explorer: Explorer, seismic_case_uuid: str):
"""Test that explorer returns openvds compatible cubes for seismic case"""
case = explorer.get_case_by_uuid(seismic_case_uuid)
Expand All @@ -286,9 +295,10 @@ def test_seismic_case_by_uuid(explorer: Explorer, seismic_case_uuid: str):
channel_list = []
for i in range(channel_count):
channel_list.append(layout.getChannelName(i))
assert 'Amplitude' in channel_list
assert 'Trace' in channel_list
assert 'SEGYTraceHeader' in channel_list
assert "Amplitude" in channel_list
assert "Trace" in channel_list
assert "SEGYTraceHeader" in channel_list


def test_utils_extend_query_object(utils: Utils):
"""Test extension of query"""
Expand Down