Skip to content

Hoist march_edges' cut, march and tip bisection to module-level functions - #380

Merged
1-Bart-1 merged 2 commits into
agent/361-march-edges-gives-each-station-the-previfrom
agent/377-cleanup-hoist-march-edges-nested-cut-mar
Sep 22, 2026
Merged

1-Bart-1 merged 2 commits into
agent/361-march-edges-gives-each-station-the-previfrom
agent/377-cleanup-hoist-march-edges-nested-cut-mar

Conversation

@1-Bort-1

@1-Bort-1 1-Bort-1 commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

TL;DR

march_edges no longer carries its logic in nested closures: the plane cut is cut_station, the one-direction march is march_stations, and the tip bisection inside it is tip_station. Output is bitwise identical; CLEAN_CODE.md §6 rules out logic in nested closures.

What moved

  • cut(point, tangent) → cut_station(vertices, faces, point, tangent), verbatim apart from the captured mesh becoming arguments.
  • march(direction) → march_stations(vertices, faces, start_le, step, direction).
  • The bisection block inside march, which sat under a comment header, → tip_station(vertices, faces, prev_le, tangent, step). Not asked for in cleanup: hoist march_edges' nested cut/march closures to module-level... #377, but it was a block wanting to be a function (§3) and pulling it out is what keeps march_stations one screen. Its two inline comments became its docstring.
  • march_edges now calls march_stations twice (negative_y, positive_y) rather than through a one-line forwarding closure.

The three are private; they sit next to march_edges on the Private Functions docs page.

march_edges' docstring now says only what it does itself; the plane and the stop rule are in cut_station and march_stations. The why it carried goes here instead: the cut plane is vertical so that a tip curling downward cannot tilt it toward horizontal, where the least-x leading-edge pick would jump across the wing. pt and r in the touched lines are now crossing and row.

How I checked it is the same

Evaluated the pre-change march_edges (from #376's head, 87624a0) into ObjAdapter as march_edges_old and compared its full return value with == against the new one on data/ram_air_kite/ram_air_kite_body.obj:

n_bins=30  stations=41  identical=true
n_bins=60  stations=81  identical=true
n_bins=90  stations=125 identical=true
n_bins=150 stations=211 identical=true

Verification

  • Reproduced first: n/a — behaviour-preserving refactor, no failing case
  • Bitwise equality against the old closure version at four step sizes (above)
  • test/obj_adapter/test_obj_adapter.jl: 260/260 pass (juliaserver, Julia 1.13), and the bitwise compare above rerun, after the review round
  • Local full suite (agent ci-local, Julia 1.13, one cell): PASS in 5 min on 82c629a, not rerun for the docstring and rename round · GitHub CI: runs on push
  • Docs build: not run locally (docs/ has no manifest and instantiating it by hand is off-limits); CI's Documentation job builds it · REUSE: repo has no bin/reuse_lint
  • Changelog: none, nothing user-visible
  • Risk: none beyond a reviewer preferring tip_station stay inline

Scope

+83 / -62 across 2 files: src/obj_adapter/obj_slice.jl and three lines in docs/src/private_functions.md. The net +18 in obj_slice.jl is the three new docstrings (21 lines) plus their signatures, ends and returns, less four lines off march_edges' docstring. Stacked on #376 (march_edges takes each station's tangent from its neighbours); review after it.

Closes #377 · task VortexStepMethod.jl-377

…ions

cut_station, march_stations and tip_station replace the closures inside
march_edges; the marched stations are bitwise identical.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@1-Bort-1 1-Bort-1 added agent:running Agent task state agent:ci Agent task state and removed agent:running Agent task state labels Sep 21, 2026

@1-Bort-1 1-Bort-1 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review (advisory)

Verdict: APPROVE WITH COMMENTS · 0 inline, 0 off the diff

Good

  • All three closures are now named module-level functions as #377 asked; compared by reading the removed and added lines side by side, the only changes are that the captured vertices/faces/mid_cut.le/step became arguments and probe_mid became probe
  • tip_station goes a little past #377, but the card names it and gives the reason: it was a block under a comment header (§3), and pulling it out keeps march_stations on one screen
  • The two inline comments in the bisection became tip_station's docstring, and the dropped 'z dropped' comment is covered by cut_station's 'vertical spanwise plane' wording, so nothing was lost
  • Bitwise == against the pre-change march_edges at four step sizes is the right evidence for a pure hoist; the card reports it with station counts
  • Every line in the file is 92 characters or less (checked with a grep for 93+ characters), and all three new private functions are listed on private_functions.md, so the docs build can reach their docstrings
  • Replacing the forwarding closure with two named calls (negative_y, positive_y) makes march_edges read top to bottom

Not good

  • The march_edges docstring (lines 343-351, not numbered in the diff) was not compacted (§7): it still explains the vertical plane cut that cut_station now documents, and repeats the stop rule that march_stations states; it should shrink to what march_edges itself does
  • That same docstring keeps a why clause ('so a tip that curls downward can't tilt the plane…'), which §4 sends to the PR; this PR was the moment to move it, since the fact now lives in cut_station
  • Short names in the moved or touched code were kept: pt in cut_station's argmin/argmax, and r in the three comprehensions in march_edges; §3 asks for crossing/row, and these lines are inside the change
  • rows = NamedTuple[] is an abstractly typed container that carried over unchanged; harmless for bitwise output, but a typed vector would be the from-scratch shape
  • The card's 'net +24 is the three new docstrings' is only roughly true: the docstrings add about 20 lines and the signatures and ends make up the rest; it does not change the verdict

claude, rubric CLEAN_CODE.md. A different lab from the implementer
on purpose: a reviewer sharing its blind spots would not flag its mistakes.

@1-Bort-1 1-Bort-1 added agent:queued Agent task state agent:running Agent task state and removed agent:ci Agent task state agent:queued Agent task state labels Sep 21, 2026
…and row locals

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@1-Bort-1

Copy link
Copy Markdown
Member Author

Fixed in 5f148b8: march_edges' docstring now says only what it does (the plane and stop rule live in cut_station and march_stations), its why moved to the card, and pt/r are now crossing/row; the card's line count is corrected. Not typing rows = NamedTuple[]: its element type follows the mesh's eltype and it carried over unchanged, so it is outside a pure hoist.

@1-Bort-1 1-Bort-1 added agent:ci Agent task state and removed agent:running Agent task state labels Sep 22, 2026
@1-Bort-1

1-Bort-1 commented Sep 22, 2026 •

Copy link
Copy Markdown
Member Author

Local full suite: PASS (4 min, Julia 1.13.0, one cell of the matrix)

@1-Bort-1

Copy link
Copy Markdown
Member Author

CI: Julia 1.12 - ubuntu-latest - x64 - pull_request failed on 5f148b8ea.

https://github.com/OpenSourceAWE/VortexStepMethod.jl/actions/runs/35670136043/job/106564760267

@1-Bort-1 1-Bort-1 added agent:queued Agent task state agent:running Agent task state and removed agent:ci Agent task state agent:queued Agent task state labels Sep 22, 2026
@codecov

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@1-Bort-1 1-Bort-1 added agent:queued Agent task state agent:running Agent task state agent:ci Agent task state agent:review Agent task state and removed agent:running Agent task state agent:queued Agent task state agent:ci Agent task state labels Sep 22, 2026
@1-Bort-1
1-Bort-1 requested a review from 1-Bart-1 September 22, 2026 01:06
@1-Bart-1
1-Bart-1 merged commit f117ec9 into agent/361-march-edges-gives-each-station-the-previ Sep 22, 2026
10 of 11 checks passed
@1-Bart-1
1-Bart-1 deleted the agent/377-cleanup-hoist-march-edges-nested-cut-mar branch September 22, 2026 12:05
@1-Bort-1 1-Bort-1 added agent:done Agent task state and removed agent:review Agent task state labels Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:done Agent task state

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants