Repository navigation
[REFACTOR] Adopt the vendored report-design layer and render inventory tables from the vendored builders - #106
Merged
Merged
Conversation
…kers (ARRAY_MAP_LEAFLET off)
…ap, history tables, array masthead, stub-reason
…uffix, stdname drop, history exclude=, map marker labels)
…umn drop) on a real dune2 file
…umn drop) on a real dune2 file
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved review findings include a critical report-generation memory-retention issue and several metadata and map-rendering correctness issues.
3 open issues
What changed in this PR
Refactors report rendering to use the shared vendored design layer, builders, templates, and interactive maps.
Changes:
- Consolidates vendored report assets and adds owned configuration.
- Migrates inventory and history tables to shared builders.
- Updates report layouts, metadata, maps, figure stubs, tests, and coverage.
| File | Change |
|---|---|
VENDORED.txt |
Removes obsolete vendoring manifest. |
tests/unit/test_vendored.py |
Tests vendored integrity checks. |
tests/unit/test_unit_label_literals.py |
Updates label-literal exclusions. |
tests/unit/test_stub_reason.py |
Tests figure failure stubs. |
tests/unit/test_report.py |
Updates report metadata tests. |
tests/unit/test_report_tokens.py |
Uses vendored design tokens. |
tests/unit/test_report_golden.py |
Updates golden-report testing. |
tests/unit/test_plot_guard.py |
Uses vendored token configuration. |
tests/unit/test_nc_tables.py |
Tests shared inventory builders. |
tests/unit/test_nav.py |
Updates navigation token tests. |
tests/unit/test_mooring_manifest.py |
Uses vendored page model. |
tests/unit/test_manifest.py |
Updates manifest tests. |
tests/unit/test_instrument_manifest.py |
Uses vendored page model. |
tests/unit/test_grid_manifest.py |
Uses vendored page model. |
tests/unit/test_base_css_no_vendored_dup.py |
Guards against duplicated CSS. |
tests/fixtures/golden/dune2/dune2_1_2026_report.html |
Rebaselines generated report output. |
tests/conftest.py |
Updates plot-error configuration. |
scripts/check_vendored.py |
Removes obsolete checker. |
pyproject.toml |
Packages vendored assets and updates configuration. |
oceanarray/reports/templates/base.html |
Uses shared navigation and sorting. |
oceanarray/reports/templates/array.html |
Adds array metadata and map rendering. |
oceanarray/reports/templates/_nc_variables.html |
Removes superseded inventory template. |
oceanarray/reports/templates/_nc_var_macros.html |
Removes superseded inventory macros. |
oceanarray/reports/templates/_nc_scalars.html |
Removes superseded scalar template. |
oceanarray/reports/templates/_nc_globals.html |
Removes superseded globals template. |
oceanarray/reports/templates/_nc_coords.html |
Removes superseded coordinates template. |
oceanarray/reports/templates/_macros.html |
Adds figure source captions. |
oceanarray/reports/templates/_instrument_files.html |
Adds sortable file ordinals. |
oceanarray/reports/templates/_grid_history.html |
Renders processing-history tables. |
oceanarray/reports/design.py |
Adds oceanarray-specific report configuration. |
oceanarray/reports/_vendored/units_display.py |
Adds shared units formatting. |
oceanarray/reports/_vendored/templates/_nc_tables.html |
Adds shared inventory macros. |
oceanarray/reports/_vendored/templates/_nav.html |
Adds shared navigation markup. |
oceanarray/reports/_vendored/templates/_map.html |
Adds shared interactive map rendering. |
oceanarray/reports/_vendored/report.mplstyle |
Provides shared plotting style. |
oceanarray/reports/_vendored/README.md |
Documents vendoring workflow. |
oceanarray/reports/_vendored/page_model.py |
Provides page models and stub reasons. |
oceanarray/reports/_vendored/MANIFEST.txt |
Records vendored file hashes. |
oceanarray/reports/_vendored/leaflet/LICENSE |
Adds Leaflet licensing information. |
oceanarray/reports/_vendored/leaflet/leaflet.min.css |
Bundles Leaflet styling. |
oceanarray/reports/_vendored/leaflet.py |
Provides map asset helpers. |
oceanarray/reports/_vendored/figure_png.py |
Adds figure source tracking. |
oceanarray/reports/_vendored/design_tokens.py |
Centralizes shared design tokens. |
oceanarray/reports/_vendored/css.py |
Generates shared CSS and sorting scripts. |
oceanarray/reports/_vendored/check.py |
Adds vendored integrity checking. |
oceanarray/reports/_vendored/__init__.py |
Initializes the vendored package. |
oceanarray/reports/_stack.py |
Migrates stack panels and handling. |
oceanarray/reports/_slots.py |
Uses vendored rendering tokens. |
oceanarray/reports/_report_css.py |
Removes superseded CSS wiring. |
oceanarray/reports/_plots.py |
Uses vendored design tokens. |
oceanarray/reports/_nc_tables.py |
Removes local inventory builders. |
oceanarray/reports/_navs.py |
Uses the vendored page model. |
oceanarray/reports/_mooring.py |
Migrates mooring panels and handling. |
oceanarray/reports/_instrument.py |
Migrates instrument panels and inventory keys. |
oceanarray/reports/_html_helpers.py |
Integrates shared metadata and history builders. |
oceanarray/reports/_grid.py |
Migrates grid panels and inventory keys. |
oceanarray/reports/_figdebug.py |
Adds figure failure capture and stubs. |
oceanarray/reports/_env.py |
Loads vendored templates and builders. |
oceanarray/reports/_array.py |
Builds array metadata and map payloads. |
oceanarray/reports/__init__.py |
Adds lazy public report imports. |
oceanarray/plotters/ts.py |
Uses vendored design tokens. |
oceanarray/plotters/timeseries.py |
Uses vendored design tokens. |
oceanarray/plotters/spectrum.py |
Uses vendored design tokens. |
oceanarray/plotters/primitives.py |
Uses vendored design tokens. |
oceanarray/plotters/hydrography.py |
Uses vendored design tokens. |
oceanarray/plotters/diagnostic.py |
Uses vendored design tokens. |
oceanarray/plotters/current.py |
Uses vendored design tokens. |
oceanarray/plotters/_cli_legacy.py |
Updates legacy style paths. |
oceanarray/config/parameters.py |
Points to the vendored matplotlib style. |
CHANGELOG.md |
Documents the refactor. |
.github/workflows/tests.yml |
Raises the coverage threshold. |
Review effort: Lite
… always degN/degE)
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
oceanarray adopts the shared
reports/_vendored/report-design layer, vendored byte-identical from ctdcast15fa38b(the family source of truth), and renders the netCDF inventory tables (coordinates, variables, scalars, global attributes) from the vendorednc_tablesbuilders and_nc_tables.htmlmacros. The six scattered vendored files and the local inventory-table code are retired.What's changed
reports/_vendored/replaces the six scattered copies and carries its ownMANIFEST.txt+check.py, soVENDORED.txtandscripts/check_vendored.pyare removed. A new ownedreports/design.pyconfigures the shared layer (accent, QC/sensor predicates,ATTR_GROUP_EXTRAS, toggles);reports/__init__.pyresolves public names lazily (PEP 562) so importing the layer does not pull the page pipeline._read_nc_metadatacallscoords_rows/variables_rows/scalars_rows/globals_rows/summary_counts); the local_nc_tables.py, five_nc_*.htmltemplates, and_html_helpersrow builders are deleted. Type labels readstring, the coordinates table gains a Dims column,historyis excluded from the globals table (exclude=("history",)) and shown only in its own panel, an all-empty Standard/long-name column drops (optional=includesstdname), and the QC marker shows the real suffix ((_qc)) coloured with--qc-mark.properties_tableplus a sortable Time·Event table with a leading#ordinal column (position inhistory, so a sort never loses order when events share a timestamp).source:captions, and a per-page<style>block stripped of rules the shared stylesheet provides (guarded bytest_no_base_rule_duplicates_vendored_css).track_map(one marker per mooring, each with a permanent name label, hover-linked to the list) behinddesign.ARRAY_MAP_LEAFLET— interactive on screen, matplotlib PNG when printing. The masthead gains deployment/recovery, position and extent, water depth, an instrument by-type breakdown, and processed-to counts from the YAMLs.as_panel) instead of vanishing.Breaking changes
None to the NetCDF outputs or the public API (
from oceanarray.reports import MooringReportis unchanged). The report HTML changes (masthead nav markup, inventory-table layout and columns, type labels nowstring,source:captions); the committed goldens are rebaselined to match.Tests
pytestgreen (1077 tests); the five dune2 goldens are rebaselined. Coverage floor raised 38% → 58% (bothmainand this branch measure 59%). New:test_vendored.py(self-contained vendored check),test_nc_tables.py(globals_rowswithATTR_GROUP_EXTRAS),test_base_css_no_vendored_dup.py,test_stub_reason.py, an empty-nc_metatolerance test, andtest_seam_history_excluded_and_stdname_column_drops— a real dune2 stage-3 file stripped of standard names and of every provenance attribute buthistory, asserting the owned call-site adoptions hold (history and its emptied group excluded; the all-empty Standard/long-name column drops) — the paths the goldens do not exercise.Notes
reports/_vendored/is upstream-managed and never edited here; the directory'scheck.pyverifies it byte-identical to ctdcast15fa38bboth ways. Two array-map gaps found while eyeballing (west-edge latitude labels clip; scale bar under the hover panel) are filed upstream and fixed on a ctdcast branch — they arrive on the next re-vendor as a separate small PR, not patched locally. This PR does not wait on them.