You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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?
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.
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.
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.
Activity
1-Bort-1 commentedon Sep 23, 2026
Queued as
VortexStepMethod.jl-387.1-Bart-1 commentedon Sep 30, 2026
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?
1-Bort-1 commentedon Sep 30, 2026
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
AirfoilAerosubmodule. 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'smasure_regressionbranch writes a polars table like theneuralfoilbranch.Direct comparison (your question). The Julia evaluator is checked against
sklearn.predictrow by row, to 1e-12:VSM_MASURE_MODELS_DIRis 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); maybeobj_adapter/obj_to_yaml.jl(models dir); newscripts/export_masure_models.py; newtest/airfoil_aero/test_masure_regression.jl+test/data/masure_fixture/;docs/src/airfoil_pipeline.md;CHANGELOG.md; typo fixes indata/TUDELFT_V3_KITE/aero_geometry*.yaml.Remove the
agent:needs-plan-approvallabel to start.Task
VortexStepMethod.jl-387.35 remaining items
1-Bort-1 commentedon Nov 25, 2026
From
VortexStepMethod.jl-419(#419), tell 214, 2026-11-25T16:01:58ZThe 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.
1-Bort-1 commentedon Nov 25, 2026
Waited on every check on #406 to pass: #406 is green, and the task has picked up again.
1-Bort-1 commentedon Nov 25, 2026
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.