Skip to content

feat(fleet): zero-value climate results for low-altitude flights & dependency updates (v0.7.10) - #66

Merged
JarryGabriel merged 7 commits into
mainfrom
chore/update-dependencies
Mar 30, 2026
Merged

feat(fleet): zero-value climate results for low-altitude flights & dependency updates (v0.7.10)#66
JarryGabriel merged 7 commits into
mainfrom
chore/update-dependencies

Conversation

@JarryGabriel

Copy link
Copy Markdown
Member

Summary

This PR introduces graceful handling of low-altitude flights in the fleet runner pipeline, updates core dependencies, and tunes several default parameters. Previously, flights that failed due to low-altitude trajectories were reported as raw errors; they now produce structured zero-value climate results, making downstream consumption consistent regardless of failure cause.

Changes

🚀 Feature — Low-altitude flight zero-results

  • FleetRunner._separate_low_altitude_errors() — new static method that splits error records into low-altitude zero-results vs other errors based on the _LOW_ALTITUDE_ERROR_MARKER sentinel.
  • _build_zero_climate_result() — builds a full climate result dict with all-zero metrics (CO2, CH4, O3, H2O, Contrails) across all time horizons, flagged with low_altitude_flight: true.
  • _extract_results() updated to use the separation logic in both the normal and pipeline-aborted code paths, ensuring low-altitude flights always appear as structured results rather than raw errors.

📦 Dependency updates

Package Before After Reason
pycontrails 0.60.1 0.60.2 Bugfix release
pybada >=0.1.11 ==0.1.12 Pin to tested version
scipy >=1.11.0,<1.17.0 >=1.11.0 Relax upper bound
  • Added [tool.hatch.metadata] allow-direct-references = true for git-sourced dependencies.

⚙️ Parameter tuning

Parameter Before After Rationale
DEFAULT_FUEL_BURN_THRESHOLD 1.1 1.2 Wider margin for edge-case aircraft
DEFAULT_MIN_ALTITUDE_FL 15 20 Better ground-level filtering (2000 ft)
MAX_NONCO2_CO2_RATIO 100.0 500.0 Reduce false-positive warnings on valid flights

🧹 Minor clean-ups

  • Removed stale inline comments (Legacy, New/Integrated) in gwp.py imports.
  • Updated MEEM acronym expansion in docstring.

🧪 Tests

  • New file: tests/test_zero_climate_result.py (384 lines) — comprehensive test suite covering:
    • _build_zero_climate_result unit tests (structure, species, horizons, NaN handling)
    • _separate_low_altitude_errors with mixed, all-low-altitude, and no-low-altitude cases
    • _extract_results functional tests (normal + aborted pipeline paths)
    • Edge cases (empty records, all errors low-altitude, no low-altitude errors)

Files changed (7)

File Change
CHANGELOG.md New v0.7.10 entry
pyproject.toml Dependency updates + hatch metadata config
src/pyneats/core/neats_default_parameters.py Parameter tuning
src/pyneats/runners/fleet.py Low-altitude zero-result feature
src/pyneats/steps/climate_metrics/gwp.py Comment clean-up
tests/test_zero_climate_result.py [NEW] Test suite
uv.lock Lock file update

JarryGabriel and others added 7 commits March 26, 2026 09:29
…hreshold for non-co2 over co2 climate impact
…ghts [AXM-907]

Add _build_zero_climate_result() to produce all-zero climate payloads
for flights rejected due to low altitude. Modified _extract_results()
to separate low-altitude errors from other errors and transform them
into structured zero-results with the low_altitude_flight marker.

New symbols: _LOW_ALTITUDE_ERROR_MARKER, _ZERO_SPECIES,
_build_zero_climate_result, _separate_low_altitude_errors.

Tests: 10 new (5 unit, 2 functional, 3 edge cases).
@JarryGabriel
JarryGabriel merged commit 75c8d6a into main Mar 30, 2026
6 checks passed
@JarryGabriel
JarryGabriel deleted the chore/update-dependencies branch March 30, 2026 14:16
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