Skip to content

Add clear_aperture and vignetted - #107

Open
TacHawkes wants to merge 2 commits into
masterfrom
feature/clear-aperture
Open

TacHawkes wants to merge 2 commits into
masterfrom
feature/clear-aperture

Conversation

@TacHawkes

Copy link
Copy Markdown
Collaborator

No description provided.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TacHawkes
TacHawkes requested a review from StackEnjoyer October 3, 2026 20:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 089e5dd700

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/ClearAperture.jl Outdated
Comment on lines +10 to +12
for b in PreOrderDFS(beam), ray in rays(b)
isect = intersection(ray)
push!(seq, isnothing(isect) ? nothing : object(isect))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Distinguish clear surfaces within each hit object

When a lens has a supported mechanical_diameter larger than its clear optical diameter, rays through the annular mechanical RingSDF can enter and exit the same Lens object twice, just as the axial ray does through the optical faces. Because this sequence stores only object identity, both paths appear as Lens, Lens, nothing, so clear_aperture can return the mechanical diameter instead of the actual clear aperture. The comparison must retain enough boundary or clear-zone information to distinguish these paths.

AGENTS.md reference: AGENTS.md:L19-L22

Useful? React with 👍 / 👎.

Comment thread src/ClearAperture.jl Outdated
Comment on lines +113 to +114
src = CollimatedSource(bundle, D, pos, d)
solve_system!(system, src; progress = false, kwargs...)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve detector state during probe traces

When system contains a Detector, every internal trial trace pushes synthetic hits into it, so a fresh detector is left containing all bisection bundles rather than user experiment data. If it already contains Gaussian-beamlet hits, the initial scalar-ray trace instead attempts to push a RayHit into that typed hit vector and throws. Isolate these probe solves from stateful components or save, reset, and restore their state inside this public function.

AGENTS.md reference: AGENTS.md:L157-L159

Useful? React with 👍 / 👎.

Comment thread src/ClearAperture.jl Outdated
Comment on lines +40 to +42
function vignetted(group::AbstractBeamGroup, reference::Beam)
ref = hit_sequence(reference)
return findall(b -> !_same_sequence(hit_sequence(b), ref), beams(group))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Support every accepted beam-group member type

AbstractBeamGroup permits groups whose members are Gaussian or astigmatic beamlets, but the callback here invokes hit_sequence(b) and the only available method accepts Beam. Calling the exported vignetted API with an AstigmaticBeamGroup, such as one returned by GaussianBeamletDecomposition, therefore raises a MethodError; either implement traversal for those beam types or narrow the method signature and documented contract to scalar-ray groups.

AGENTS.md reference: AGENTS.md:L103-L109

Useful? React with 👍 / 👎.

@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.10%. Comparing base (7709212) to head (eba1d51).
⚠️ Report is 35 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #107      +/-   ##
==========================================
+ Coverage   87.88%   88.10%   +0.21%     
==========================================
  Files          73       74       +1     
  Lines        4442     4505      +63     
==========================================
+ Hits         3904     3969      +65     
+ Misses        538      536       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…mlet groups

Compare (object, boundary part) pairs so the mechanical rim of a lens is not
confused with its optical faces, save and restore detector hits during the
probe traces, and support beamlet groups via their chief rays.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@StackEnjoyer StackEnjoyer added the enhancement New feature or request label Oct 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants