Skip to content

v2.2.0

Choose a tag to compare

@github-actions github-actions released this 16 Apr 15:48
· 46 commits to main since this release

opentop v2.2.0

Two major additions merge in this release: a package-wide refactor (originally scoped as v2.2) and a new OpenSky flight-replay CLI.

Breaking changes

  • MultiPhase removed — use CompleteFlight instead; identical behavior for typical flight-envelope problems.
  • trajectory() rejects unknown kwargs — TypeError instead of silently ignoring. All options are now explicit keyword parameters.
  • opentop.vis.map renamed to opentop.vis.plot_map (the old name shadowed builtins.map).
  • optimizer.solver is soft-deprecated — still works with a DeprecationWarning, will be removed in a future release. Use optimizer.stats / optimizer.success / optimizer.objective_value instead.

New features

  • opentop replay CALLSIGN CLI command — fetches a real flight from OpenSky by callsign, pulls ERA5 meteo from fastmeteo, builds a contrail interpolant if the objective needs one, runs a comparison optimization, and saves actual.parquet + optimized.parquet + trajectory.png side-by-side. Flag mode or interactive wizard (run opentop replay with no args). Requires pip install "opentop[replay]" for the optional dependencies.
  • Reusable Python API — opentop.replay.fetch_flight, infer_aircraft, build_meteo_and_wind, build_contrail_interpolant, normalize_flight_for_vis — use from scripts/notebooks without the CLI.
  • trajectory(..., result_object=True) returns a TrajectoryResult dataclass with df, success, status, objective, iters, fuel, grid_cost, stats fields.
  • vis.trajectory(df | [df1, df2]) — accepts a list of DataFrames to overlay traces on the same axes with automatic legend.

Internal changes

  • base.py split into focused pure-function modules: _dynamics.py, _objectives.py, _trajectory.py, _options.py, _multi_start.py, _types.py.
  • cli.py split into a cli/ package with one module per subcommand.
  • Full type annotations across the public API; pyright in basic mode blocks CI.
  • ruff format + ruff check enforced via CI and pre-commit hooks; black, isort, flake8 removed from dev deps.
  • New committed test fixtures: real EDDB→LEMD contrail interpolant (contrail_4d.casadi) and OpenSky flight trace (flight_ryr880w_2023-01-05.parquet).

Correctness fixes (during the refactor)

  • Cruise no longer double-initializes x_guess when initial_guess= is passed.
  • Climb colinearity constraint rewritten as cross-product form — no longer divides by zero on near-north-south routes.
  • PolyWind rewritten without eval() and now correctly applies the Ridge intercept (silently dropped before).
  • Hardcoded 3.14159 replaced with np.pi in projection math.
  • fuel_cost / grid_cost no longer overcounted by one trailing segment.
  • User-input validation uses ValueError instead of assert (strip-safe under -O).

See docs/superpowers/specs/2026-04-15-* for the full design history if you're reading the repo.