Repository navigation
Bump ruff to 0.17.1 and pycontrails to 0.64 (PS engine deterioration) - #57
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
meanandsqrtentries from the backend's__all__.pycontrails 0.64: engine deterioration (a real model change)
pycontrails 0.64 changed where engine deterioration is applied:
eta_1at load time, aseta_1 * (1 - 0.025).eta_1, andPSFlightapplieseta_1 / (1 + f)when it evaluates.openleaf copies
eta_1from 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_factordefaults to 0.025, as in pycontrails.PSModel(..., engine_deterioration_factor=...)takes it as an option, alongsidethrust_buffer.ps_physics.overall_propulsion_efficiencyapplies 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-reducedeta_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:
-W error::FutureWarningmkdocs build --strictSupersedes #53.
🤖 Generated with Claude Code