Repository navigation
Conversation
`_zdw_near` refined each sign change of the dispersion with a scalar Brent search, which evaluates the cladding's glass model on every iterate. An index model evaluates an array at about the cost of one point, so four rounds of 33 samples reach the noise of the differenced `beta2` for a fraction of the cost: `capillary_params` takes about 2.5 times less time. The rounds also stop short of a pole of the differenced `beta2`, which Brent converges onto until the model returns NaN: xenon in a 14 um capillary at 15 bar raised `ValueError` from the search, and now reports its zero. A sign change that samples which are not finite separate is dropped, as one at the first sampling already was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tools._zdw_nearrefined each sign change of the dispersion with a scalar Brent search, which evaluates the cladding's glass model on every iterate, about 190 evaluations per call. An index model evaluates an array at about the cost of one point, so this refines with four rounds of 33 samples and a final linear interpolation instead. It speeds upcapillary_params,soliton_paramsand the zero-dispersion design target.brentqis still used elsewhere intools.py, so its import stays.Timing
capillary_paramsat 14 um and 15 bar, on an Apple M5 Max. These are medians of 15 calls, repeated twice with the two searches alternating in one process. The machine was busy (load average 7 to 9), so read the ratios rather than the absolute times.What changes in the results
beta2. The new test holds this at 1e-8 on seven of those cases, against a Brent search over 200 nm to 3 um.main, xenon at 14 um and 15 bar raisesValueErrorfrombrentq, because Brent converges onto a pole of the differencedbeta2until the model returns NaN. It now reports 960.57 nm, which the same test confirms._zdw_nearreports sign changes of the differencedbeta2beside a gas resonance as zeros #527.Verification
tests/test_tools.py,tests/test_design_solvers.py,tests/test_soliton_content.pyandtests/modes/test_capillary.py: 323 passed, onnumpy_ref.ruff format --check, basedpyright, codespell, numpydoc andpoe changelog-checkare clean.Related: #157 (the same question in
modes.base.zdw) and #527.🤖 Generated with Claude Code