Skip to content
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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
27 changes: 7 additions & 20 deletions tests/test_foxes.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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():
Expand Down