Skip to content

Commit

Permalink
Add python 3.12 to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Sep 2, 2024
1 parent 2207f77 commit 0a232cf
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.11"]
python-version: ["3.8", "3.11", "3.12"]
os: [ubuntu-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "setuptools_scm", "wheel"]
requires = ["setuptools", "setuptools_scm"]

[tool.pytest.ini_options]
addopts = "-m 'not spe1'"
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"webviz-config>=0.0.40",
"webviz-config-equinor",
"webviz-subsurface-components",
"importlib_resources; python_version<'3.9'",
],
setup_requires=["setuptools_scm"],
use_scm_version=True,
Expand Down
8 changes: 6 additions & 2 deletions tests/data/spe1_st/tests/test_webviz_ert.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def test_webviz_parameter_comparison(dash_duo):
"default",
)

_ensemble_name = select_first(dash_duo, "#" + plugin.uuid("ensemble-multi-selector"))
_ensemble_name = select_first(
dash_duo, "#" + plugin.uuid("ensemble-multi-selector")
)
_verify_keys_in_menu(
dash_duo, plugin, parameter_keys, "parameter-selector-multi-param"
)
Expand Down Expand Up @@ -95,7 +97,9 @@ def test_webviz_response_comparison(dash_duo):
"default",
)

_ensemble_name = select_first(dash_duo, "#" + plugin.uuid("ensemble-multi-selector"))
_ensemble_name = select_first(
dash_duo, "#" + plugin.uuid("ensemble-multi-selector")
)
_verify_keys_in_menu(
dash_duo, plugin, parameter_keys, "parameter-selector-multi-param"
)
Expand Down
2 changes: 1 addition & 1 deletion webviz_ert/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def filter_experimental_pages(
page: Dict[str, Any], experimental_mode: bool
) -> bool:
if "experimental" in page and page["experimental"]:
return experimental_mode
return experimental_mode
return True

new_config_dict["pages"] = [
Expand Down
12 changes: 7 additions & 5 deletions webviz_ert/assets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import json
import sys
from pathlib import Path

import pkg_resources
if sys.version_info >= (3, 9):
from importlib.resources import files
else:
from importlib_resources import files
from webviz_config.webviz_assets import WEBVIZ_ASSETS

ASSETS_DIR = Path(pkg_resources.resource_filename("webviz_ert", "assets"))
ASSETS_DIR = Path(files("webviz_ert")) / "assets"
WEBVIZ_ASSETS.add(ASSETS_DIR / "bootstrap-grid.css")
WEBVIZ_ASSETS.add(ASSETS_DIR / "bootstrap.min.css")
WEBVIZ_ASSETS.add(ASSETS_DIR / "ert-style.css")
Expand All @@ -13,9 +17,7 @@

COLOR_WHEEL = ERTSTYLE["ensemble-selector"]["color_wheel"]

WEBVIZ_CONFIG = (
Path(pkg_resources.resource_filename("webviz_ert", "assets")) / "webviz-config.yml"
)
WEBVIZ_CONFIG = Path(files("webviz_ert")) / "assets" / "webviz-config.yml"


def get_color(index: int) -> str:
Expand Down
2 changes: 1 addition & 1 deletion webviz_ert/controllers/controller_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def _valid_response_option(response_filters: List[str], response: Response) -> bool:
if "historical" in response_filters and response.name.split(":")[0][-1] == "H":
return False
return False

if "obs" in response_filters:
return response.has_observations
Expand Down
4 changes: 2 additions & 2 deletions webviz_ert/controllers/observation_response_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def _create_misfits_plot(
realizations,
[],
{
"hovermode":"closest",
"uirevision":True,
"hovermode": "closest",
"uirevision": True,
},
)
return ensemble_plot
Expand Down
2 changes: 1 addition & 1 deletion webviz_ert/data_loader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def get_ensemble_record_data(
try:
df.index = df.index.astype(int)
except (TypeError, ValueError):
with contextlib.suppress((TypeError, ValueError)):
with contextlib.suppress(ValueError):
df.index = df.index.map(pd.Timestamp)
df = df.sort_index()
return df
Expand Down

0 comments on commit 0a232cf

Please sign in to comment.