From d4d723a0b8e0d948e29217e65144164f6ed3c662 Mon Sep 17 00:00:00 2001 From: Mathew Topper Date: Tue, 21 Apr 2026 13:11:11 +0100 Subject: [PATCH] chore: improve tests and update dead link This commit updates the following: - Increased timeout lengths for tests that require NEMOH to run in the background - Replaces dead link to DTOcean project archival info - Updated minimum scipy version - Fixed typo --- packages/dtocean-hydrodynamics/README.md | 16 +++++++++++++++- packages/dtocean-hydrodynamics/pyproject.toml | 2 +- .../modules/test_modules_hydrodynamics.py | 1 - .../dtocean_wec/projects/load_nemoh/conftest.py | 2 +- .../run_nemoh/test_run_nemoh_form_hyd.py | 2 +- poetry.lock | 2 +- 6 files changed, 19 insertions(+), 6 deletions(-) diff --git a/packages/dtocean-hydrodynamics/README.md b/packages/dtocean-hydrodynamics/README.md index af7216ac..ef458fda 100644 --- a/packages/dtocean-hydrodynamics/README.md +++ b/packages/dtocean-hydrodynamics/README.md @@ -136,6 +136,20 @@ poetry run ruff poetry run pyright src ``` +The above tests can be run across all compatible Python versions using +[tox](https://tox.wiki/) and [tox-uv](https://github.com/tox-dev/tox-uv). To +install: + +```sh +poetry install --with test --with test-extras --with audit --with tox +``` + +To run the tests: + +```sh +poetry run tox +``` + ## Contributing Please see the [dtocean](https://github.com/DTOcean/dtocean) GitHub repository @@ -144,7 +158,7 @@ for contributing guidelines. ## Credits This package was initially created as part of the [EU DTOcean project]( -https://www.dtoceanplus.eu/About-DTOceanPlus/History) by: +https://cordis.europa.eu/project/id/608597) by: * Francesco Ferri at [Aalborg University](https://www.en.aau.dk/) * Pau Mercade Ruiz at [Aalborg University](https://www.en.aau.dk/) diff --git a/packages/dtocean-hydrodynamics/pyproject.toml b/packages/dtocean-hydrodynamics/pyproject.toml index 97e6ffdb..b70735e7 100644 --- a/packages/dtocean-hydrodynamics/pyproject.toml +++ b/packages/dtocean-hydrodynamics/pyproject.toml @@ -62,7 +62,7 @@ numpy = "^2.3.5" pandas = "^3.0.1" pyopengl = "^3.1.7" scikit-learn = "^1.6.0" -scipy = "^1.14.1" +scipy = "^1.17.0" shapely = "^2.0.6" polite-config = { path = "../polite-config", develop = true } contourpy = "^1.3.1" diff --git a/packages/dtocean-hydrodynamics/tests/dtocean_plugins/modules/test_modules_hydrodynamics.py b/packages/dtocean-hydrodynamics/tests/dtocean_plugins/modules/test_modules_hydrodynamics.py index 0128e314..f0669027 100644 --- a/packages/dtocean-hydrodynamics/tests/dtocean_plugins/modules/test_modules_hydrodynamics.py +++ b/packages/dtocean-hydrodynamics/tests/dtocean_plugins/modules/test_modules_hydrodynamics.py @@ -284,7 +284,6 @@ def test_tidal_interface_entry_fail( with pytest.raises(ValueError): interface.connect(debug_entry=True) - interface.connect(debug_entry=True) def test_convert_results(outputs_wp2_wave): diff --git a/packages/dtocean-hydrodynamics/tests/dtocean_wec/projects/load_nemoh/conftest.py b/packages/dtocean-hydrodynamics/tests/dtocean_wec/projects/load_nemoh/conftest.py index cd3b4c05..0a626a7e 100644 --- a/packages/dtocean-hydrodynamics/tests/dtocean_wec/projects/load_nemoh/conftest.py +++ b/packages/dtocean-hydrodynamics/tests/dtocean_wec/projects/load_nemoh/conftest.py @@ -81,7 +81,7 @@ def is_enabled(): assert main_window.form_power is not None assert main_window.form_power.isEnabled() - qtbot.waitUntil(is_enabled) + qtbot.waitUntil(is_enabled, timeout=30000) return run_nehom_path / "hydrodynamic" diff --git a/packages/dtocean-hydrodynamics/tests/dtocean_wec/projects/run_nemoh/test_run_nemoh_form_hyd.py b/packages/dtocean-hydrodynamics/tests/dtocean_wec/projects/run_nemoh/test_run_nemoh_form_hyd.py index b977040e..aed686ed 100644 --- a/packages/dtocean-hydrodynamics/tests/dtocean_wec/projects/run_nemoh/test_run_nemoh_form_hyd.py +++ b/packages/dtocean-hydrodynamics/tests/dtocean_wec/projects/run_nemoh/test_run_nemoh_form_hyd.py @@ -38,4 +38,4 @@ def test_calculate_again( def is_enabled(): assert form_hyd_calculated.btn_calculate_t2.isEnabled() - qtbot.waitUntil(is_enabled) + qtbot.waitUntil(is_enabled, timeout=30000) diff --git a/poetry.lock b/poetry.lock index 54ac2e02..8105c771 100644 --- a/poetry.lock +++ b/poetry.lock @@ -892,7 +892,7 @@ polite-config = {path = "../polite-config", develop = true} pyopengl = "^3.1.7" pyside6 = "^6.9.0" scikit-learn = "^1.6.0" -scipy = "^1.14.1" +scipy = "^1.17.0" shapely = "^2.0.6" shiboken6 = "^6.9.0"