Setup Test is failing - #312
Conversation
write_section_aero writes an all-NaN deflected .dat when a deflection never converges; read_dat_coordinates drops it to empty, and the audit-mode plot_slices_3d crashed on the Kulfan fit of the empty contour, taking the ram-air kite example (and the setup test) down with it. generated_slices now treats such a contour like a missing one -- warn and skip the overlay -- and fit_pts guards empty input. Regression test: test/plotting/test_plotting.jl.
|
Local full suite: PASS (6 min, Julia 1.12.7, one cell of the matrix) |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Are you sure this is not a regression for the wrapping under delta deflection? |
A deflected `.dat` that is present but holds no finite coordinates and one that was never written both produced the same warning, which read as a missing file. The warning now tags each skipped file with which of the two it was. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PxVf66FdRwo7h2e6nWosBp
|
No — I measured the deflected wrap itself rather than through the plot. At δ=1° all eight non-degenerate sections of the example's own geometry give 239 contour nodes (as at δ=0), no non-finite point, no fold, enclosed area within 0.1% of δ=0, and XFoil converges at the same 16–17 of 18 angles; sections 1 and 10 are dropped on thickness before any deflection is formed. The blank |
…ection Main's #312 rewrote the same block of `generated_slices` to skip a blank deflected .dat. Kept its `skipped_deltas` structure and its blank-vs-missing message, and put back the `delta_suffix` tag and the dropped naming-scheme sentence; the skipped file is now named by its path under `out_dir`, which the warning states. The changelog entry moved to a fresh `## Unreleased` section, v5.1.0 having been cut in between. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017d2wohXpAyJ9qCV1FhoDJd
…-def Only CHANGELOG.md conflicted: v5.1.0 shipped and #312's audit-plot entry landed in the Fixed block this branch's entry sat in. The entry moves to Unreleased. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WLm7oza8A7H8xtGQP2hp7Z
TL;DR
The audit
plot_slices_3dcrashed on a generated deflection.datthat reads back with no coordinates, taking the wholeSetup Testdown withram_air_kite.jl; it now skips that overlay and warns, naming the file and whether it was blank or absent.What was wrong
ram_air_kite.jl:79runs the audit plot over the generatedpolars_xfoildirectory atdelta=1.0.generated_slicesreadairfoils/<id>_d1.dat, got zero points back, and handed the empty contour to the Kulfan fit:ArgumentError: reducing over an empty collectionout ofargmininnormalize_airfoil(src/airfoil_aero/kulfan.jl:71), throughfit_ptsatext/VortexStepMethodMakieExt.jl:1676. The file was there, so theisfilebranch that already warns and draws nothing for a deflection that was never generated did not fire.It reads back empty because it holds
NaN NaNrows andread_dat_coordinatesdrops any line that does not start with a digit,-or.. A deflection column ofSectionAero.xstays at itsfill(NaN, …)initial value when no angle of that deflection lands a solution of the grid's modal node count (src/airfoil_aero/section_aero_gen.jl:27-38), andwrite_section_aerowrites that column out unguarded — three lines above the guard that already refuses to write{id}.datall-NaNfor exactly this reason.So the audit plot has two ways to have no deflected contour to draw and only handled one of them. It now handles both the same way, and the warning says which:
Skipping the delta=1.0° overlay for 4_d1.dat: no finite coordinates; …against… 4_d1.dat: no such file; ….Is the blank column a regression in the wrapping under delta deflection?
Asked on the thread, and worth the check — a plot that skips a contour is a plot that can hide a bad one. I measured the deflected wrap directly rather than through the plot, on the example's own geometry and settings (10 slices of
ram_air_kite_body.obj,wingtip_distance=0.1,ShrinkWrap(clearance=0.0),crease_frac=0.75,Re=1e6, XFoilnpan=160/ncrit=9/xtrip=(0.05, 0.05), α = −8:2:26°).Sections 1 and 10 are thrown out on thickness (0.424 against a 0.225 limit) before any deflection is formed — that is the
Reused the nearest valid airfoil for: section 1 → airfoil 2, section 10 → airfoil 9line in the CI log, and it is about the raw tip slices, not about δ. For the eight sections that remain, the 1° deflected wrap is indistinguishable in health from the undeflected one: 239 contour nodes either way, no non-finite coordinate, chord normalised to [0, 1], no fold on either surface, enclosed area within 0.1% of δ=0, and XFoil converges at exactly the same 16–17 of the 18 angles. No blank column reproduces on this box at all.That matches what the mechanism says it should be. The contour that reaches the
.datisdeform_section's own output — #301 measured XFoil handing it back unchanged atrepanel=false,max|dx| = max|dy| = 0.0— so the shape never depends on the solver converging; only its presence does. A blank column therefore means "no angle of that deflection landed", not "the deflected wrap produced garbage".generate_airfoilsvalidates onlysols[1], the δ=0 column (src/airfoil_aero/geometry_gen.jl:48), so a dead deflection column leaves no trace anywhere else.Per-section numbers, δ=0 against δ=1°
What this change can and cannot hide
It cannot hide a wrong deflected contour. The skip fires only on a contour with no usable coordinate at all; anything finite is fitted and drawn exactly as before, and the
fit_ptsguard returns an empty point vector only for an input that previously threw. The deflected contour is also the only one that can reach it empty:write_section_aeroalready refuses to write{id}.datall-NaN, and the live path'sshrink_wrapthrows rather than hand back nothing — so no overlay goes quiet without the warning above. What it does change is that a deflection the solver never landed now reaches the reader as a named warning rather than as a stack trace — and, after this round, as a warning that does not read like a missing file, which is the case #298 is about.Found on the way
deform_section's docstring (src/airfoil_aero/airfoil_solvers/common.jl:100-102) still promises that the re-wrap "bridges the crease with amin_concave_radiusfillet". Since1e13d92the wrap offsets the ball's contact polygon instead of sweeping its rim, so a concavity narrower than the ball is bridged straight (src/airfoil_aero/shrink_wrap.jl:139-146), and at theclearance = 0.0that path uses, the contour is the contact polygon itself. The crease geometry the solvers are handed is therefore not what that docstring says. It is behaviour-neutral to fix and in a file this diff has no other reason to open, so it is not in here.The producer-side half — that
write_section_aerowrites the all-NaNcolumn at all, and thatgenerate_airfoilsnever notices a deflection that converged nowhere — is #300, open as #301. The two are complementary: with #301 merged the file is absent rather than blank and this plot takes its other branch, and until then (or for a directory generated before it) this is what stops the crash.Verification
ArgumentError: reducing over an empty collectionfromnormalize_airfoil/argmin,ext/VortexStepMethodMakieExt.jl:1632→kulfan.jl:71, identical to theSetup Teststack on run 34653119608test/plotting/test_plotting.jl"Audit slices (Makie)" red before, green after (juliaserver): the empty-contour assertions errored before4c799ad; the warning assertion failed before8ded002with the old textNo generated .dat for delta=1.0° (4_d1.dat); now 7/7, file 84/848ded002· GitHub CI on8ded002:Setup Testgreen,CIgreen on the rerunCIattempt wastest/solver/test_forwarddiff.jl's AD-against-finite-difference check,relative_error = 0.0400against1e-4, withnorm_fwd = 2.114327230856032— The generated ram-air polar fixture is not reproducible, so every test asserting numbers on it draws a fresh geometry each run #291's documented draw of the regenerated ram-air fixture, in code this diff does not touch (nosrc/change at all); green on rerun of that job alonedocs/srcpage changed.dat, not by a generated one.Scope
+48 / −10 across 3 files:
ext/VortexStepMethodMakieExt.jl(the skip and the warning),test/plotting/test_plotting.jl(the regression test),CHANGELOG.md. No stack; #301 touches the writer and the readers, not this.Closes #311 · task
VortexStepMethod.jl-311