Skip to content

[REFACTOR] Report inventory tables (coordinates + attribute disclosure), canonical-unit fixture, demo-notebook cleanup - #103

Merged
eleanorfrajka merged 3 commits into
mainfrom
rep/tables-and-notebooks
Oct 12, 2026
Merged

eleanorfrajka merged 3 commits into
mainfrom
rep/tables-and-notebooks

Conversation

@eleanorfrajka

Copy link
Copy Markdown
Collaborator

Summary

Reworks the NetCDF-inventory appendix in the mooring reports to match the glidertest form, canonicalises the units stored in the dune2 test fixture, refreshes the hosted dune2 demo suite, and moves the broken old-API demo notebooks to legacy so 0.5.0 ships only working demos.

What's changed

Report inventory tables, shared across the instrument, grid and stack pages:

  • New Coordinates table (one row per coordinate variable: type, units, standard/long name, min/max, N valid, attributes), replacing the bare dimensions table; grid gains this table (it had none).
  • Per-row Attributes disclosure (N attrs) listing the variable's remaining attributes; attributes already shown in a column (units, long_name, standard_name) are excluded.
  • QC companions shown inline as a green (_QC) on the variable name instead of a separate flag column.
  • Scalars reordered to Variable / Type / Units / Standard-long name / Value, with the attribute disclosure.
  • Global attributes gain a Type column; float64 and datetime64 types are bold throughout.
  • Six near-duplicate per-page templates collapsed to one shared set (_nc_variables, _nc_coords, _nc_scalars, _nc_globals, _nc_var_macros); _html_helpers._read_nc_metadata now returns coordinate rows and per-variable attribute dicts via a shared _variable_row helper.

Fixture:

  • dune2 test fixture units rewritten to canonical spellings (degC/°C to degree_Celsius, mS/cm to mS cm-1, meters to m) in place — 14 attribute edits across 8 files, data byte-identical (factor-1 renames only; verified against HEAD).

Docs / notebooks:

  • Hosted dune2 demo suite regenerated from the full mooring (new table design + canonical units).
  • demo_mooring.ipynb ported to oceanarray.processors.process; demo_step1.ipynb removed (folded into demo_mooring).
  • Five notebooks that no longer import against the current package moved to notebooks/legacy/: demo_instrument, demo_stage1, demo_stage2 (removed staged API, superseded by demo_mooring) and demo_check_clock, demo_clock_offset (moved-module imports). Legacy README rewritten; clock_offset.rst link repointed.

Breaking changes

None. Report HTML layout changes and fixture unit-label changes only; no public API, CLI, or output-schema change.

Tests

pytest green after the report-golden rebaseline (REBASELINE_GOLDEN=1 pytest tests/unit/test_report_golden.py); test_report.py::test_read_nc_metadata_global_attrs updated for the new {value, type} global-attr shape.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical notebook and documentation workflow failures, plus unresolved datetime and scalar-coordinate handling issues, remain.

3 open findings
What changed in this PR

Refactors NetCDF inventory reporting, canonicalizes dune2 fixture units, and reorganizes demo notebooks.

Changes:

  • Adds shared coordinate, variable, scalar, and attribute-rendering templates.
  • Updates report goldens and fixture unit labels.
  • Moves obsolete notebooks to legacy and refreshes documentation links.
File Summary
tests/​unit/​test_report.py Updates typed global-attribute expectations.
tests/​fixtures/​golden/​dune2/​instrument/​dune2_1_2026_2941_report.html Rebaselines instrument report output.
tests/​fixtures/​golden/​dune2/​dune2_1_2026_stack_report.html Rebaselines stack report output.
tests/​fixtures/​golden/​dune2/​dune2_1_2026_report.html Rebaselines report output.
tests/​fixtures/​golden/​dune2/​dune2_1_2026_grid_report.html Rebaselines grid report output.
oceanarray/​reports/​templates/​base.html Adds shared disclosure styling.
oceanarray/​reports/​templates/​_stack_nc_dims.html Removes obsolete dimensions template.
oceanarray/​reports/​templates/​_nc_variables.html Defines shared variable inventory markup.
oceanarray/​reports/​templates/​_nc_var_macros.html Provides shared variable rendering macros.
oceanarray/​reports/​templates/​_nc_scalars.html Defines shared scalar inventory markup.
oceanarray/​reports/​templates/​_nc_globals.html Defines shared global-attribute markup.
oceanarray/​reports/​templates/​_nc_coords.html Defines shared coordinate inventory markup.
oceanarray/​reports/​templates/​_instrument_nc_variables.html Removes instrument-specific variable template.
oceanarray/​reports/​templates/​_instrument_nc_scalars.html Removes instrument-specific scalar template.
oceanarray/​reports/​templates/​_instrument_nc_globals.html Removes instrument-specific global template.
oceanarray/​reports/​templates/​_grid_nc_variables.html Removes grid-specific variable template.
oceanarray/​reports/​templates/​_grid_nc_scalars.html Removes grid-specific scalar template.
oceanarray/​reports/​templates/​_grid_nc_globals.html Removes grid-specific global template.
oceanarray/​reports/​_stack.py Replaces dimension inventory with coordinates.
oceanarray/​reports/​_nc_tables.py Groups variables and global attributes.
oceanarray/​reports/​_instrument.py Uses shared inventory panels.
oceanarray/​reports/​_html_helpers.py Builds coordinate and typed metadata rows.
oceanarray/​reports/​_grid.py Adds coordinate inventory support.
oceanarray/​reports/​_env.py Centralizes inventory rendering.
notebooks/​legacy/​README.md Documents legacy notebooks.
notebooks/​legacy/​demo_stage2.ipynb Relocates obsolete demo.
notebooks/​legacy/​demo_stage1.ipynb Relocates obsolete demo.
notebooks/​legacy/​demo_instrument.ipynb Relocates obsolete demo.
notebooks/​legacy/​demo_clock_offset.ipynb Relocates obsolete demo.
notebooks/​legacy/​demo_check_clock.ipynb Relocates obsolete demo.
notebooks/​demo_step1.ipynb Removes superseded demo.
docs/​source/​clock_offset.rst Repoints the legacy notebook link.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread notebooks/demo_mooring.ipynb Outdated
Comment thread notebooks/legacy/README.md
Comment thread oceanarray/reports/_html_helpers.py Outdated
@eleanorfrajka
eleanorfrajka merged commit 3381bc1 into main Oct 12, 2026
8 checks passed
@eleanorfrajka
eleanorfrajka deleted the rep/tables-and-notebooks branch October 12, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants