[FEAT] Section-manifest ports for the stack, instrument, and mooring reports - #80
Merged
Conversation
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.
Summary
Finishes the report section-manifest rollout begun with grid (#79). The stack, instrument, and mooring pages are each ported onto the same declarative system — a per-page context + a registry of
Panels wrapping the unchanged figure adapters, aProfileof orderedSections, and one shared macro that renders every page. After this branch all four report pages render throughresolve()+ the sharedreport_body/panelmacros; the page templates' content blocks are a single macro call, and the pre-manifest slot shim is gone.It is one PR with separable, individually-re-baselined commits so each diff reads on its own (per-page ports, then cross-page polish from an eyeball-review pass).
What changed
All four pages are manifest-driven. Each page declares its sections/panels; the resolver generates the jump-nav, numbers the headings (content
(1)…(N), appendices(A),(B)), renders each panel, and drops inapplicable sections to a "not applicable" footer. This fixes real defects: the mooring page's hand-typed numbering (it started at "2" and had a "3.5"), instrument's two mutually-exclusive "Current roses" headings, and stack's velocity headings that had no anchor id.One shared body macro.
report_body(report, na_scope, generated, cruise, yaml_path)in_macros.htmlrenders the jump-nav + numbered section loop + footer; grid/stack/instrument/mooring content blocks are now just that call. Section numbers render in parentheses(1) Filesin both headings and jump-nav; the duplicated literal "Jump to:" is dropped (.jump-nav::beforesupplies it).Captions are a plain-text data field (
*_CAPTIONSdicts, Unicode notation, rendered escaped) — never|safe— because they will become user-editable via a futureconfig/report.yaml. Structured content (windows explainer, QC tables, analog list, NetCDF tables, the mooring pipeline/timing/calibration/issues blocks, the PDF diagram embed) renders throughkind="html"/"table"sub-templates emitted|safe.Layout. New
Panel.slot=None(bare.fig, no width contract) for figures not rendered through the slot system, and newSection.layout="row"— a wrapping flex row that placesslot="half"figures side-by-side (mooring knockdown HAB+anomaly, stack aquadopp/adcp trajectories) with aslot="full"figure wrapping to its own line.NetCDF appendix split: (A) NetCDF variables (dimensions + variables + scalar metadata) and (B) NetCDF attributes (global attributes), on grid/stack/instrument.
Footer (shared): centered (matches ctdcast); drops the report-generator host (already in the file's
processor_machine/processor_osmetadata); adds the cruise and the oceanarray version; the mooring footer keeps its config-file path.oceanarray.__version__is now exposed (from the setuptools-scm_version.py, with fallbacks) and shown when meaningful.Slot-shim cleanup: deletes
_slots._SLOT_BY_B64+slot_for()(the slot now travels on the resolved panel);_slots.renderkeeps only width forwarding.Also: re-vendored
config/report_tokens.py+reports/_css.pybyte-identical to ctdcast; fixed the current-direction colorbar (showedm s⁻¹, now°with compass ticks); shared the history/NetCDF-table render helpers across pages; moved the figure collapse toggle into shared chrome.Breaking changes
#temp/#sal/#pressure→#hydrography,#dims/#vars→#netcdf_variables/#netcdf_attributes; grid/instrument likewise); headings are numbered(N)/(A); the jump-nav is generated; captions are plain text (no<code>/<strong>). Sections whose data/instrument-type does not apply now appear in a "Not applicable" footer instead of being silently omitted. The instrument "Start & end windows" section id is deliberately preserved as#start(mooring deep-links to it). Migration: any external deep-link into a report anchor must use the new section-id anchors (an audit found none in this repo or the docs).generate_stack_page/generate_instrument_pages/ the mooring generator no longer take the per-figure keyword arguments — each builds its context and resolves a profile internally. No callers outsidereports/pass them._manifest.pymodel gained fields (Panel.slotnow acceptsNone; newSection.layout;ResolvedSection.layout) — re-vendor to ctdcast alongside thePanelGroup/unavailable_ifadditions from # [FEAT] Report section-manifest model and resolver #78.Generated by oceanarray v{version} • {cruise} • {date}(+• config: {path}on mooring); the report-generator hostname is no longer shown.