Skip to content

Support the masure regression #387

Open

Description

@1-Bart-1

The python version of this package already supports the masure regression. In a similar way as in which we support neuralfoil, we should make a submodule such that we can support the masure regression.

Activity

  1. added
    agent:needs-plan-approval
    on Sep 23, 2026
  2. 1-Bort-1 commented on Sep 23, 2026

    @1-Bort-1
    Member

    Queued as VortexStepMethod.jl-387.

  3. added
    agent:running
    agent:waiting-human
    and removed
    agent:queued
    agent:running
    on Sep 23, 2026
  4. 1-Bart-1 commented on Sep 30, 2026

    @1-Bart-1
    MemberAuthor

    So we convert the tree to an npz? Isn't that tricky or difficult to get right? Can we do a full-Julia version of the tree and then an npz alternative so we can directly compare?

  5. added
    agent:queued
    agent:running
    and removed
    agent:waiting-human
    agent:queued
    on Sep 30, 2026
  6. 1-Bort-1 commented on Sep 30, 2026

    @1-Bort-1
    Member

    Review plan — #387 masure regression (revised after comment 5910987987)

    Objective. Let a geometry YAML entry [id, masure_regression, {t, eta, kappa, delta, lambda, phi}] resolve to polars in Julia, as the Python VSM does, instead of erroring "not yet supported".

    Approach. Same shape as NeuralFoil: pure Julia inside the AirfoilAero submodule. The Python models are three ~2.3 GB scikit-learn Extra-Trees pickles on Zenodo, one per Re = 1e6, 5e6, 2e7, with outputs CD, CL, CM. A one-off Python script dumps each tree's five flat arrays (children_left/right, feature, threshold, value) to .npz. A Julia evaluator walks the trees and averages them. resolve_airfoil's masure_regression branch writes a polars table like the neuralfoil branch.

    Direct comparison (your question). The Julia evaluator is checked against sklearn.predict row by row, to 1e-12:

    • In CI, a committed few-KB fixture holds a small sklearn Extra Trees and its predictions.
    • On the real models, the check runs when VSM_MASURE_MODELS_DIR is set.

    The pitfalls the test catches are the float32 cast sklearn applies before each split comparison, Pipeline/MultiOutput wrapping, and the CD-first column order.

    Option, if you meant it: retrain the Extra Trees in Julia from Masure's CFD dataset, with no pickles at all, and compare it against the npz model. It can only agree statistically, because the splits are random. It also needs an Extra-Trees trainer Julia lacks, so I'd make it a separate issue.

    Files expected. New src/airfoil_aero/masure_regression.jl; AirfoilAero.jl; airfoil_io.jl (branch + docstring); maybe obj_adapter/obj_to_yaml.jl (models dir); new scripts/export_masure_models.py; new test/airfoil_aero/test_masure_regression.jl + test/data/masure_fixture/; docs/src/airfoil_pipeline.md; CHANGELOG.md; typo fixes in data/TUDELFT_V3_KITE/aero_geometry*.yaml.


    Remove the agent:needs-plan-approval label to start.
    Task VortexStepMethod.jl-387.

  7. removed
    agent:running
    on Sep 30, 2026
  8. 35 remaining items

  9. 1-Bort-1 commented on Nov 25, 2026

    @1-Bort-1
    Member

    From VortexStepMethod.jl-419 (#419), tell 214, 2026-11-25T16:01:58Z

    The masure models on Zenodo 16925759 were trained with their 5th input around 0.65 and their 6th around 0.25: the scalers in ET_re5e6 and ET_re1e6 (converted with your scripts/export_masure_models.py) hold input_mean[5] = 0.6485 (scale 0.031) and input_mean[6] = 0.2497 (scale 0.112). The Zenodo tutorial calls them lambda (camber tension, default 0.30) and phi (LE tension, default 0.65), yet its own sanity row passes [.., 0.65, 0.25]. So the names in MASURE_PARAMETERS ("lambda", "phi") are swapped relative to the training data: a user passing lambda=0.30, phi=0.65 as the profile generator defines them puts the 5th input 11 standard deviations outside training. Suggest naming the 5th input phi and the 6th lambda (or documenting the swap in airfoil_pipeline.md), with a test that reads the scaler means from the fixture. #419 holds both at the training means meanwhile.

  10. added
    agent:running
    and removed
    agent:queued
    on Nov 25, 2026
  11. 1-Bort-1 commented on Nov 25, 2026

    @1-Bort-1
    Member

    Waited on every check on #406 to pass: #406 is green, and the task has picked up again.

  12. added
    agent:queued
    agent:running
    and removed
    agent:running
    agent:queued
    on Nov 25, 2026
  13. 1-Bort-1 commented on Nov 25, 2026

    @1-Bort-1
    Member

    On tell 214 from VortexStepMethod.jl-419: Fixed in 446099c on #406: phi now goes in as the 5th input and lambda as the 6th. A new test checks that phi reaches input 5 and lambda input 6; with the old order it failed both checks. I tied it to the training code rather than the fixture's scaler means, since the fixture is synthetic: Masure's columns are [t, cx, cy, r, LE, camTE, a], LE is held at 0.65 and camTE runs 0.1–0.4, which gives your 0.6485 and 0.2497. The Python VSM has the same swap; it is listed on the #406 card for the owner.

  14. added
    agent:ci
    agent:review
    and removed
    agent:running
    agent:ci
    on Nov 25, 2026
  15. removed
    blocking
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent:review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions