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.
Adding masure_regression to AirfoilAero: a pure-Julia evaluator for the sklearn Extra-Trees models (exported to .npz by a one-off script in scripts/), wired into resolve_airfoil so a wing_airfoils entry resolves to a polars table like neuralfoil. Parity-tested against sklearn.predict on a small committed forest. Leaving out retraining in Julia, shipping/downloading the 2.3 GB models, and an on-disk polar cache.
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.
Activity
1-Bort-1 commentedon Sep 23, 2026
Adding masure_regression to AirfoilAero: a pure-Julia evaluator for the sklearn Extra-Trees models (exported to .npz by a one-off script in scripts/), wired into resolve_airfoil so a wing_airfoils entry resolves to a polars table like neuralfoil. Parity-tested against sklearn.predict on a small committed forest. Leaving out retraining in Julia, shipping/downloading the 2.3 GB models, and an on-disk polar cache.
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.16 remaining items