Repository navigation
Audit the 91 docstrings against their code, and hold every tutorial to one writing doctrine - #42
Merged
Conversation
Five parallel reviewers read every docstring against its forward() -- equations re-derived, Axes lines checked against the batch registers, parameter lists against the dataclass fields, doctests executed. Four findings were code bugs the prose exposed. Resampler resampled axis 0, scipy's default, while promising the last axis. SelectiveMIMOChannel validated its input against N_r instead of N_t and rejected every non-square channel's correct frames. BlindCFOCompensator's history stored 16 times the frequency offset; it now stores the omega_0 iterates it documents, renamed history_ (D23). Laser drew its "random" initial phase from a Gaussian of std 2 pi instead of uniformly. The rest is prose catching up with code. Equations straightened: BWFilter's mask was off by 2 against its own parameters section, AmplitudeDemapper decides on |Re y| per quadrature lane rather than |y|, the Rice path of TappedDelayLineChannel now carries the gamma_0 scaling the code applies, and the optical alpha_dB conversion is typeset unambiguously. Stale claims deleted: seven phantom pre-D46 parameters on FiberLink and DBP replaced by one fiber: FiberSpec entry, the inert norm field of FrequencyDomainEqualizer removed, 1-D-only Axes lines on broadcasting blocks rewritten, "multiplied" for a division, a "time" method that never existed. The MIMO detectors' stored decisions are S_ (D23), the CMA equalizer is written W since H is the channel everywhere else, BPS gained the Attributes section phase_ deserved, and PtsPaprReductor validates its (T, F) layout in prepare() instead of dying on a bare IndexError. The batch registers were corrected on the way: DelayRemover and BlindPhaseTracker verified BROADCAST, Normalizer moved to EXEMPT with its pooling documented. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…echnique Both pages carried simulation scaffolding that drowned the reader: a factory building chains behind a kind flag, draw counts that grew with the SNR, zipped channel sweeps, an interpolation coda reading numbers off a closed form, mermaid dumps at the end of the scripts. They are rewritten on one doctrine, now encoded in the tutorial skill. The page opens on ONE chain, one channel draw, no batch: the problem shown plainly. The simulation then draws a FIXED stack of channels once -- rayleigh_channel(size=K), the same K draws at every SNR point, so the reader compares curves rather than draw counts -- builds one Sequential per technique, written out in full with the stack on the channel block and on the detector, and runs one monte_carlo per technique sweeping the noise variance, zipped into the detector when it weights by it (MMSE, OSIC). No simulation loop at all. On the MIMO page each technique is one unit, interleaved: its idea and equations, then its chain and its sweep quoted together. To make it possible SpaceTimeDecoder accepts a stacked H -- channel k decodes frame k, locked in tests/mimo/test_stacked_channel.py -- and both Alamouti blocks join the BROADCAST register of the batch contract. The Alamouti script drops from 210 to 164 lines and runs in 4.2 s; the MIMO script from 190 to 216 lines but with every technique contiguous, in 8.9 s; both pages re-paste their runs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The PAPR page loses its transmitter factory: one Sequential for the illustration, a second for the other subcarrier count -- two chains, written out. The 20-batch accumulation loop becomes one call, because Serial2Parallel already stacks the OFDM symbols on the leading axis: 20000 symbols are one batch, and compute_papr(axis=-1) reads one value per row. The models-against-measurement coda is deleted and the level-crossing model shrinks to one sentence; the page keeps the one number an amplifier is sized on. one_shot_ofdm drops its two-iteration loops. The SER sweep is two explicit monte_carlo calls, one per chain, same seeds so the pasted table is unchanged; the runtime study is one loop over the swept lengths with both chains timed explicitly in the body, and its volatile numbers are re-pasted from a single fresh run. The tutorial skill now states the rule: a loop earns its place at ten iterations, not at two -- no loop over the techniques, dict literals for two curves, one call per chain. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…rams Three chains, written out -- uncoded, hard, soft -- and three explicit monte_carlo calls in place of a factory pair and a three-iteration loop; the per-curve timing prints and the hand-rolled aligned lines become two print_data tables, the second confronting the soft measurement with the union bound where the page discusses it. The LDPC study builds ONE chain and reconfigures its decoder between the two sweeps with set_params(decoder__n_iter=25) instead of rebuilding the Sequential inside a loop. The mermaid dump and the stray plt.show are gone, the page re-pastes its tables from one run, and the measured values are unchanged -- same seeds, same draws. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The conventions sweep over every page-backed script. monte_carlo_awgn loses its chain factory -- one Sequential written inline, and the constellation-order study reconfigures it with set_params instead of rebuilding -- and its mermaid export; the awgn page drops the diagram section, whose feature demo lives in the getting-started page. The one_shot_mimo cost study unrolls its two-technique loop into one sweep loop timing both chains explicitly, and its metric dict is a literal. The PAPR page's theory references become a dict literal. The shaping script keeps its interpolation -- it reads the page's own computed capacity curves, not a closed form -- and loses only the mermaid dump. All four pages remapped and range-checked. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The GN-model script drops its mermaid dump and plt.show, and its page drops the diagram and the include that quoted the dump; the factory stays, because its source genuinely changes structure -- a Gaussian stimulus against a mapped constellation. The profiling script keeps its mermaid export -- the getting-started page it backs presents chain introspection as the content -- and loses only the trailing plt.show. The two DBP scripts keep their factories: that is the one sanctioned chain split, for the Monte-Carlo cost of re-propagating the fibre. The CHANGELOG now records the whole doctrine sweep, including the entry the container rollback ate. Co-Authored-By: Claude Opus 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.
Six commits, two threads: the docstring audit, and the tutorial writing doctrine.
The 91 Processor docstrings audited against their code
Five parallel reviewers read every docstring against its
forward()— equations re-derived, Axes lines checked against the batch registers, parameter lists against the dataclass fields, doctests executed. 62 findings fixed, four of them code bugs the prose exposed:Resamplerresampled axis 0 (scipy's default) while promising the last axis;SelectiveMIMOChannelvalidated its input against N_r instead of N_t, rejecting every non-square channel's correct frames;BlindCFOCompensator.historystored 16× the offset (nowhistory_, D23, storing the ω₀ iterates it documents);Laserdrew its "random" initial phase from a Gaussian of std 2π instead of uniformly on [−π, π). The rest is prose catching up: seven phantom pre-D46 parameters onFiberLink/DBP, the inertnormfield ofFrequencyDomainEqualizerremoved, wrong equations straightened (BWFiltermask,AmplitudeDemapperdecision, the Rice path), stale 1-D-only Axes lines,S_(D23) on the detectors, the CMA equalizer written W.Every tutorial script held to one writing doctrine
Now encoded in the tutorial skill, applied to the whole set:
Sequentialper technique, written out — no factories. Adef get_chain(kind)survives only when the structure genuinely varies (the GN-model's Gaussian-vs-mapped source, the two DBP scripts — the one sanctioned chain split, for the Monte-Carlo cost of re-propagating the fibre).rayleigh_channel(size=K), one draw = one batch row), handed to the channel block and the detector at construction.SpaceTimeDecoderaccepts a stacked H to make it possible.monte_carlocall per technique — no simulation loop, the noise variance zipped into the detectors that weight by it (MMSE, OSIC). A loop earns its place at ten iterations, not at two.plt.showare gone (the shaping page keeps its interpolation — it reads its own computed capacity curves — and the getting-started pages keep the oneto_mermaidfeature demo each).n_iterbyset_paramson one chain; the AWGN order study reconfigures one chain the same way.Rewritten and re-pasted from real runs: Alamouti (210→164 lines, 4.2 s), MIMO detectors (interleaved, 8.9 s), PAPR (the 20-batch loop is one call —
Serial2Parallelalready stacks symbols on the leading axis), OFDM, coding, AWGN, GN model, shaping. All page ranges re-checked by the two docs ratchets.Full suite green: 939 tests + 1225 subtests, example smoke tests, ruff, pyright strict (0 errors), sphinx -W.
🤖 Generated with Claude Code
Generated by Claude Code