Repository navigation
Conversation
KiteGeometry's two-argument calc_heading was its own function, so loading it beside KiteUtils left calc_heading ambiguous. It is now a method of KiteUtils.calc_heading, re-exported as the same binding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1-Bort-1
left a comment
There was a problem hiding this comment.
Independent review (advisory)
Verdict: APPROVE WITH COMMENTS · 1 inline, 0 off the diff
Good
- src/transforms.jl:120 adds the method to
KiteUtils.calc_headinginstead of defining a second function, so both packages share one name; this is the single-codepath fix §2 asks for and matches the card - src/KiteGeometry.jl:18 imports
calc_headingfrom KiteUtils, so the existing export now re-exports the same binding; the card says this and the export list is unchanged - The internal caller at src/transforms.jl:206 still works unqualified through the imported binding; I checked this with grep
- docs/src/structure.md:71 points the
@docsentry at the two-argument signature, so the page shows only KiteGeometry's docstring and not KiteUtils' whole function; the card says the docs build clean - CHANGELOG entry is one compact line under Fixed, describes the change users will see, and is not hard-wrapped
- The diff is small and has one idea; nothing changed that the card does not name
Not good
test/test-transforms.jl:142— The testset proves only that the two bindings are identical. It never calls both forms unqualified underusing KiteUtils, KiteGeometry, so a dispatch collision such as a future two-argument KiteUtils method replacing this one would not be caught here. One call of each form in the probe would cover the risk the card itself names.- The new method has untyped arguments on a function KiteGeometry does not own (type piracy by arity); the card names the risk, but a follow-up issue in KiteUtils to reserve or type the two-argument form would make it visible to people working on that package
- The test's
Module()plusCore.evalprobe is clever where@test KiteGeometry.calc_heading === KiteUtils.calc_headingwould prove the same thing in plain code; identical bindings already rule out the ambiguity - The card does not say what was searched before writing (§2 'say in the PR what you searched for'), e.g. other
calc_headingcallers in the ecosystem that rely on KiteGeometry's own function - Full suite and CI are reported as not awaited or pending, so the merge depends on CI going green
claude, rubric CLEAN_CODE.md. A different lab from the implementer
on purpose: a reviewer sharing its blind spots would not flag its mistakes.
Pin which package owns each method and call each through the binding `using KiteUtils, KiteGeometry` resolves, so a two-argument method added to KiteUtils that replaced this one would fail here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
KiteUtils has a new release now, so why not directly use KiteUtils' function? |
|
KG should not have duplicate/overlapping functions with KiteUtils. Use the KiteUtils functions |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
KU v0.14 (released now) has the other sign in this function, so you don't need the minus sign anymore, just pin KU to 0.14. |
|
The minus signs stay: KiteUtils 0.14.0 didn't change calc_heading. Its code is the same in v0.13.1, v0.14.0 and main. What 0.14 flipped is azimuth_east (OpenSourceAWE/KiteUtils.jl#165), which KiteGeometry doesn't call. On KiteUtils 0.14.0, test/test-transforms.jl passes 26/26 as the branch stands. Dropping the leading minus fails 6 of 26: a placed kite reads -2.337 rad where 0.436 is expected. Dropping the minus on the azimuth argument fails the same 6. So #71 has nothing to change and keeps its KiteUtils bound; #79 already widens it to 0.14. |
turn! negated transform.azimuth to get KiteUtils' east-to-north azimuth, which goes wrong as soon as the transform's azimuth changes sense, as #86 does. Reading it off radial_direction holds in either sense, and dividing by cos(elevation) keeps it continuous through the zenith. The test helper now measures heading from where the kite stands rather than repeating the same sign, so a mismatch fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KiteGeometry had its own
calc_heading(R_b_to_w, pos), a second function under the same name as thecalc_heading(attitude, elevation, azimuth)KiteUtils exports. Loading both packages, as every KiteViewers user does, made the name ambiguous, and the two computed the same angle. KiteGeometry now uses KiteUtils' function to turn a kite to its heading when it places a system, and no longer defines or exports one of its own.using KiteUtils, KiteGeometrythen gives one unambiguouscalc_heading.This removes public API, so the changelog marks it BREAKING. A caller of the two-argument form passes the elevation and azimuth instead; the minus sign is because KiteUtils' heading turns the other way to KiteGeometry's.
A transform's
headingkeeps the sense it had, so every authoring document places the kite exactly where it did before. Making it turn the way KiteUtils' heading does would change every document's input; that is the owner's call, in the same spirit as the azimuth convention question on OpenSourceAWE/SymbolicAWEModels.jl#430.This works with KiteUtils 0.13 and 0.14 alike: it passes the azimuth as an angle rather than calling
azimuth_east, whose sign changed in 0.14.This merges in either order with #86, which turns a transform's azimuth the other way: placement reads the east-to-north azimuth KiteUtils wants off the direction the transform turns its object to, rather than negating the transform's azimuth. No follow-up is needed whichever lands second. I chose this over stacking on #86, which would have tied this change to a larger one for the sake of one sign.
KiteViewers can now drop its line that disambiguates
calc_heading; that change is KiteViewers'.Verification
test-transforms.jl27/27,test-structure.jl172/172,test-authoring.jl655/655.test-transforms.jlred with the azimuth negated (kite heading 0.930 rad where 0.436 is wanted), 30/30 with this change;test-authoring.jlandtest-structure.jlpass.reuseis not installed on the box · merges cleanly with mainKiteGeometry.calc_heading(R, pos)breaks; within the ecosystem I know only the KiteViewers line named above.Opened by
1-Bort-1, an AI agent working for @1-Bart-1.Closes #70 · task
KiteGeometry.jl-70Refs OpenSourceAWE/KiteViewers.jl#57