diff --git a/pyproject.toml b/pyproject.toml index 7243809..099bc51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ classifiers = [ requires-python = ">=3.9,<3.12" dependencies = [ "py_wake>=2.6.5", - "foxes>=1.6.2", + "foxes>=1.7.0", "windIO @ git+https://github.com/EUFlow/windIO.git", "wayve @ git+https://gitlab.kuleuven.be/TFSO-software/wayve@dev_foxes", #"numpy<2", diff --git a/tests/test_foxes.py b/tests/test_foxes.py index ac22881..4e32388 100644 --- a/tests/test_foxes.py +++ b/tests/test_foxes.py @@ -1,7 +1,7 @@ import os from pathlib import Path +from shutil import rmtree -from foxes import Engine, reset_engine from windIO import __path__ as wiop from windIO import validate as validate_yaml @@ -10,30 +10,17 @@ test_path = Path(os.path.dirname(__file__)) windIO_path = Path(wiop[0]) -engine = None - def _run_foxes(wes_dir): assert wes_dir.is_dir(), f"{wes_dir} is not a directory" - global engine - if engine is None: - engine = Engine.new("default", verbosity=0) - engine.initialize() - print("SETTING ENGINE:", engine) - for yaml_input in wes_dir.glob("system.yaml"): - if "_noXYgrid" not in str(yaml_input): - print("\nRUNNING FOXES ON", yaml_input, "\n") - validate_yaml(yaml_input, Path("plant/wind_energy_system")) - output_dir_name = Path("output_test_foxes") - output_dir_name.mkdir(parents=True, exist_ok=True) - try: - run_foxes(yaml_input, output_dir=output_dir_name, engine=None) - except Exception as e: - reset_engine() - engine = None - raise e + print("\nRUNNING FOXES ON", yaml_input, "\n") + validate_yaml(yaml_input, Path("plant/wind_energy_system")) + output_dir_name = Path("output_test_foxes") + output_dir_name.mkdir(parents=True, exist_ok=True) + run_foxes(yaml_input, output_dir=output_dir_name) + rmtree(output_dir_name) def test_foxes_KUL():