Skip to content

Bump ruff to 0.17.1 and pycontrails to 0.64 (PS engine deterioration) - #57

Merged
ramondalmau merged 2 commits into
mainfrom
build/ruff-pycontrails
Oct 19, 2026
Merged

ramondalmau merged 2 commits into
mainfrom
build/ruff-pycontrails

Conversation

@ramondalmau

Copy link
Copy Markdown
Collaborator

Replaces Dependabot's grouped update #53 (ruff 0.17.1, pycontrails up to 0.64), which failed CI on lint and on 13 PS tests.

ruff 0.17.1

  • RUF068: removes the duplicate mean and sqrt entries from the backend's __all__.
  • Markdown formatting: ruff 0.17 formats Python code blocks in Markdown, so the README and docs examples now follow the same style as the code.

pycontrails 0.64: engine deterioration (a real model change)

pycontrails 0.64 changed where engine deterioration is applied:

  • Before (0.60.4): the factor was folded into the tabulated eta_1 at load time, as eta_1 * (1 - 0.025).
  • Now (0.64.0): the table holds the raw eta_1, and PSFlight applies eta_1 / (1 + f) when it evaluates.

openleaf copies eta_1 from those tables. Bumping the version alone would therefore have silently dropped the deterioration, and every PS fuel flow would have come out 2.5 % low. The 13 failing tests were comparisons against pycontrails catching exactly that.

The fix mirrors pycontrails:

  • PSEngineData.engine_deterioration_factor defaults to 0.025, as in pycontrails.
  • PSModel(..., engine_deterioration_factor=...) takes it as an option, alongside thrust_buffer.
  • ps_physics.overall_propulsion_efficiency applies it.

As a result, fuel flow is exactly (1 + f) × the undeteriorated value, and the new test pins this. PS efficiencies move by 0.06 % against the old (1 - f) form; for example, A320 cruise η goes from 0.30620 to 0.30639.

pycontrails is now >=0.64,<0.65: older releases ship the pre-reduced eta_1, which would count the deterioration twice. The PS aircraft tables are byte-identical between 0.60.4 and 0.64.0, so nothing else changes.

Verification

All CI gates pass locally:

  • ruff check and format
  • mypy for both packages
  • pytest: 1014 passed, 233 BADA-data skips; also passes with -W error::FutureWarning
  • pip-audit
  • mkdocs build --strict

Supersedes #53.

🤖 Generated with Claude Code

ramondalmau and others added 2 commits October 19, 2026 12:06
ruff 0.17 reports two duplicate entries in the backend's __all__ (mean,
sqrt; RUF068), removed here, and formats Python code blocks in
Markdown, so the README and docs examples now follow the same style as
the code.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…64 does

pycontrails 0.64 stopped folding the engine deterioration factor into
the tabulated eta_1 (it was eta_1 * (1 - 0.025) at load time) and
applies eta_1 / (1 + f) in PSFlight instead. openleaf copies eta_1 from
those tables, so on 0.64 every PS fuel flow would silently drop the
deterioration and come out 2.5 % low.

PSEngineData gains engine_deterioration_factor (default 0.025, as in
pycontrails), PSModel and its constructors take it as an option like
thrust_buffer, and ps_physics.overall_propulsion_efficiency applies it
as pycontrails does. Fuel flow is now exactly (1 + f) times the
undeteriorated value; efficiencies move by 0.06 % against the old
(1 - f) form. The PS aircraft tables are byte-identical between
0.60.4 and 0.64.0.

Require pycontrails>=0.64,<0.65: older releases ship the pre-reduced
eta_1, which would count the deterioration twice. _init_from_data now
derives the engine data with model_copy instead of copying every field.

Supersedes the pycontrails part of Dependabot's grouped update (#53);
uv.lock also carries that PR's ruff bump.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ramondalmau
ramondalmau merged commit 094e72c into main Oct 19, 2026
8 checks passed
@ramondalmau
ramondalmau deleted the build/ruff-pycontrails branch October 19, 2026 10:14
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