Skip to content

Add time-resolved Numba fp x flux operator - #1703

Open
brendan-m-murphy wants to merge 6 commits into
develfrom
codex/fp-x-flux-keep-space
Open

Add time-resolved Numba fp x flux operator#1703
brendan-m-murphy wants to merge 6 commits into
develfrom
codex/fp-x-flux-keep-space

Conversation

@brendan-m-murphy

@brendan-m-murphy brendan-m-murphy commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

  • add a public, lazy fp_x_flux_time_resolved_numba operator in openghg.analyse
  • retain source, lat, and lon for later basis projection
  • use a Numba/Dask block kernel for regular hourly footprints
  • support source selection and relabelling, single-source flux, and regular coarse-frequency flux
  • apply an explicit observation-time selector only after constructing the full calculation
  • preserve source metadata coordinates
  • add optional atomic float32 ppm Zarr persistence with a provenance manifest
  • add an optional distributed-worker Numba warm-up helper
  • expose Numba through the optional fp-x-flux dependency extra
  • install the optional fp-x-flux extra in GitHub Actions so mypy and tests exercise the Numba path

Motivation and impact

Verification-games needs a source-resolved footprint-times-flux field without an automatic latitude/longitude reduction. Earlier forward_model_tests applied that reduction downstream, so it does not define a separate spatial-retention variant. The explicit fp_x_flux_time_resolved_numba name makes this optimized implementation opt-in alongside the existing xarray paths while allowing callers to sum or project the spatial dimensions later.

The native result is dimensionless mole fraction. The persistence helper converts it to ppm per unit source scaling.

Validation

  • 49 focused and regression tests passed, including:
    • direct parity with the existing time-resolved implementation
    • hourly multi-source and single-source inputs
    • 2-hour and 24-hour coarse flux
    • existing integrated CO2 behavior
    • existing irregular-time behavior on the legacy path
    • lazy import coverage
  • Black passed
  • Flake8 passed
  • uv sync --extra dev --extra fp-x-flux passed (Numba 0.66.0)
  • uv lock --check passed
  • git diff --check passed

Checklist

  • Closes an existing issue
  • Tests added and passed
  • Black and Flake8 checks passed
  • Documentation updated
  • Tutorial updated — not required for this low-level analysis API
  • Wiki updated — not required
  • Changelog entry added
  • New package requirement added to pyproject.toml
  • recipes/meta.yaml updated — not required because Numba is an optional extra and the recipe derives only the base runtime environment

@brendan-m-murphy
brendan-m-murphy marked this pull request as ready for review August 7, 2026 15:46
@brendan-m-murphy brendan-m-murphy changed the title Add source-resolved fp x flux operator Add time-resolved Numba fp x flux operator Aug 7, 2026
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.

1 participant