Repository navigation
Show a summary at the start of every run; mode_average=True in the tutorials - #31
Merged
Merged
Conversation
run_problem builds one block from the kernel problem, the run's metadata and the backend's execution record (solprop.driver.summary): backend, threads, precision, grid, representation, medium and fill, responses (Raman named on or off), shot noise with model and seed or off, integrator, tolerances, absorber, save planes, output and resume state. It reaches the reporter through the optional SummarisingReporter.summary call, so it follows progress=: a bar writes it and the closing line on its stream unless a console handler would print them, 'log' logs them at INFO, 'none' shows nothing. Plane stores keep it as the run_summary annotation, outside the record and its hash, so no schema change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The air-mixture and envelope-plasma tutorials built a one-mode Simulation by hand; Simulation.from_capillary(..., mode_average=True) is the route. Ionisation inventories agree with the hand-built runs (the air run's final energy is 0.05 % lower: the constructor's default temporal absorber), and the envelope comparison still agrees to 0.004 %. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A run with no optmat rate still writes no peak-field annotation; it now carries the run summary, so the test asks for the one it means. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sume equality The layers figure lists every module, so it draws driver/summary.py; the reporter docstrings name SummarisingReporter.summary by its full path for Sphinx; and the moving-guide resume comparison leaves out the run_summary annotation, which records a resumed file's two starts by design. 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! |
jtravs
added a commit
that referenced
this pull request
Oct 27, 2026
SEP 35's carrier-frame Adams kernels ported from general.cpp into the policy-templated general_impl.hpp. Kernel schema 38 and output schema 27 for SEP 36 (main took 37 for SEP 35 and 26 for SEP 37); SEP 36's ADR renumbered ADR-057 after ADR-055 (SEP 37) and ADR-056 (PR #33). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Every run now opens with one block saying what it is about to compute, so a default nobody chose (no shot noise, say) is visible before the run spends time on it. It also converts the last hand-built mode-averaged tutorials to
mode_average=True. No default changes: noise, integrator and tolerances are as they were.What the printout looks like
These are real runs on a terminal (
progress="auto"draws a bar). First a mode-averaged argon capillary with a gradient fill, plasma and input noise:Then a GNLSE fibre run with the defaults (
prop_gnlse):With
raman=Truethe Raman line readsRaman, fraction 0.2188 held back from Kerr. On a resume,startreadsresuming at z = …, k of n planes to go.How it works
run_problembuilds the summary (solprop.driver.summary.run_summary) from the kernel problem, the run'sRunMetadataand the backend's ownmetadata(). Every route goes throughrun_problem: all sixprop_*functions,Simulation.runandSimulationRunner. The metadata'sconfigurationsupplies what the problem holds only as compiled tables: the response objects, the mixture and the pressure profile. When a problem is run directly with a record that has no configuration, the responses are named from the compiled terms instead.progress=. The block goes to the reporter through a new optional call,SummarisingReporter.summary(text). It works like the existingInterruptibleReporter:NullReporterhas a no-op, and a reporter written to the four basic calls is simply not shown the summary."auto"on a terminal or in a notebook, or"bar"): the summary and the closing line are written to the bar's stream. They used to be log records only, which nobody saw because the package installs just aNullHandler. If a console handler is configured that would print them anyway, they are only logged, so they appear once."log": both areINFOrecords onsolprop.log, as before."none": nothing.run_summaryannotation: a list of{"title", "rows"}, and a resume appends its own. Annotations sit outside the record and its hash, so the output schema stays at 25. Putting the summary inRunMetadataitself would have needed a new field and a bump to schema 26. I didn't do that, because every row is derived from fields the record already holds.progress="none", so they show no summary. The outer scan bar is created withecho=False, so it does not print a meaningless "finished at z = N m: 0 steps" line.noiserow of a printedSimulationnamed the realisation's class; it now givesinput model, seed 5.docs/guide/performance/progress.md(sample, routing table, annotation) and noted inresults/provenance.mdand architecture §14. The API index and the CHANGELOG (Added and Fixed) are updated.The mode-averaged examples
I checked every
replace(anddefault_spec("mode_averaged")hit underdocs/examples,docs/tutorials,docs/introductionanddocs/guide. The ones that remain are unrelated:tutorials/basics/plot_03_analysing_a_run.py.No worked example still used the old route (the MI-ensemble and Raman-comb examples had already been converted), so no gallery output needed regenerating.
Two focused tutorials built a one-mode
Simulation(grid, mode, …)by hand. They now useSimulation.from_capillary(..., mode_average=True):tutorials/capillaries/plot_04_air_mixture.py: the ionisation inventories are identical. The final energy is 0.05 % lower, because the constructor applies its default temporal absorber. The tutorial's slow regression test (test_air_tutorial, pinned to an independent oracle) passes in 20 s.tutorials/capillaries/plot_05_envelope_plasma.py: the carrier-resolved and envelope runs still agree to 0.004 %. The fractions differ from the hand-built ones by about 1e-6 relative.Focused tutorials regenerate on every docs build, so there is no committed output to update.
Verification
tests/driver/test_summary.py, covering the summary per route (GNLSE, mode-averaged and resolved capillary, mixture, radial, Cartesian, line, planar, vector) and its routing (event order, bar stream,"log","none", a reporter without the call, a directrun_problem, resume appending).tests/test_log.py: the bar's echo rule.--dist loadgroupon numpy_ref and numba_cpu (native not installed locally), all passing:tests/driver,tests/output,tests/processing,tests/plotting;test_log,test_package,test_guide_snippets,test_display,tests/backends/test_driver.py;summary.pyis at 100 % branch coverage from its own tests.🤖 Generated with Claude Code