Skip to content

Expand PyWake submodel support with case-insensitive lookup and tests #52

@bjarketol

Description

@bjarketol

Summary

WIFA's PyWake adapter (wifa/pywake_api.py) currently supports only a small subset of the models available in PyWake. This expands all 6 submodel categories to cover the practical PyWake models, adds case-insensitive name matching, and adds parametrized unit tests.

Changes

New _normalize_name() helper

Case-insensitive model name matching — strips whitespace, lowercases, removes - and _. Handles windIO naming inconsistencies (e.g. TurbOPark vs TurboPark).

Expanded submodels

Category Before After New models
Deficit 5 11 Niayifar2016, Zong2020, Carbajofuertes2018, TurboNOJ, GCL, SuperGaussian2023
Deflection 2 3 GCLHill
Turbulence 4 6 GCL, IEC-TI-2019
Superposition 2 5 Max, Weighted, Cumulative
Rotor averaging 2 6 EqGrid, GQGrid, PolarGrid, CGI
Blockage 3 9 SelfSimilarityDeficit, RankineHalfBody, Rathmann, VortexCylinder, VortexDipole, HybridInduction

Other improvements

  • Removed 9 debug print() statements, replaced default warnings with warnings.warn()
  • Bastankhah2016 raises NotImplementedError with helpful message pointing to foxes or alternatives
  • Product superposition raises NotImplementedError (not available in PyWake)

Tests

  • New tests/test_pywake_submodels.py: 104 parametrized unit tests covering all configure functions
  • All 10 existing integration tests pass (no regressions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions