Skip to content

BUG: keep Open-Meteo ensemble members on the same pressure levels - #1242

Merged
MateusStano merged 1 commit into
developfrom
bug/open-meteo-ensemble-levels
Nov 28, 2026
Merged

MateusStano merged 1 commit into
developfrom
bug/open-meteo-ensemble-levels

Conversation

@MateusStano

Copy link
Copy Markdown
Member

Related to #1209 (the "Open-Meteo ensemble pressure levels" item).

Pull request type

  • Code changes (bugfix, features)

Checklist

Current behavior

set_atmospheric_model(type="open_meteo_ensemble") reads each member and skips the pressure levels that come back empty. The members are then cut to the same length by position, and all of them share one list of pressures (level_ensemble), taken from the shortest member.

If two members miss different levels, rows no longer line up. Example with 19 levels, where one member has no data at 1000 hPa and another has none at 30 hPa:

Row 0 really is Row 0 is labelled
Member without 1000 hPa 975 hPa 975 hPa
Member without 30 hPa 1000 hPa 975 hPa

select_ensemble_member builds the pressure profile from that shared list, so the second member gets a pressure (and density) that is one level off, about 2.5 % near the ground. Temperature and wind are not affected, because each member keeps its own heights.

New behavior

Only the pressure levels that every member has are kept, and each member's rows are picked by pressure level instead of by position. A ValueError is raised when the members have fewer than two levels in common.

Nothing changes when all members have the same levels, which is what the live API returns today: I checked gfs05 (31 members, 3 sites) and ecmwf_ifs025 (51 members, 2 sites) on 2026-11-28, and in both every member had the same 13 levels. So this is a latent problem, not one seen in real data.

Two tests were added. Both fail on develop.

Breaking change

  • No

Additional information

@Gui-FernandesBR, #1209 does not say what "Open-Meteo ensemble pressure levels" refers to. This is the only problem I found in that code. Is it what you meant?

🤖 Generated with Claude Code

Each member drops the pressure levels that come back empty. The members
were then cut to the same length by position and given one shared list
of pressures, so two members missing different levels ended up with rows
labelled with the wrong pressure. Keep only the levels every member has,
picked by pressure, and raise when fewer than two are shared.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@MateusStano
MateusStano requested a review from a team as a code owner November 28, 2026 20:21
@codecov

codecov Bot commented Nov 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.04%. Comparing base (3394ad5) to head (e1dc63f).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1242   +/-   ##
========================================
  Coverage    87.04%   87.04%           
========================================
  Files          130      130           
  Lines        18130    18131    +1     
========================================
+ Hits         15782    15783    +1     
  Misses        2348     2348           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MateusStano
MateusStano merged commit c51c4ab into develop Nov 28, 2026
10 checks passed
@MateusStano
MateusStano deleted the bug/open-meteo-ensemble-levels branch November 28, 2026 20:44
MateusStano added a commit that referenced this pull request Nov 28, 2026
Describe the forecast reuse and the opt-in disk cache that replaced the
first cache (#1219), and add the PRs merged after the backfill: #1221,
#1222, #1223, #1224, #1231, #1232, #1234, #1239 and #1242.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@MateusStano MateusStano mentioned this pull request Nov 28, 2026
11 tasks done
MateusStano added a commit that referenced this pull request Nov 28, 2026
* DOC: backfill the v1.14.0 changelog

The changelog automation has not run since #1112, so the PRs merged into develop after it were missing from [Unreleased]. Add them, add the entries for #1225, #1226 and #1227, update the tip-off, tube-fins and parachute-seed entries to what the release ships, and drop the raw commit link, the back-merge entry and the duplicate StochasticFreeFormFins entry.

Related to #1209

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDW575d9C9zpS7Z1v2KXVq

* DOC: add a Breaking changes section to the v1.14.0 changelog

List what changes for a v1.13.0 user: Monte Carlo seeding and numbering, the deprecated static_margin assignment, the parachute trigger ValueError on the rail, the shifted flight results, and the sensor default temperature.

Related to #1209

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDW575d9C9zpS7Z1v2KXVq

* DOC: bring the v1.14.0 changelog up to date with develop

Describe the forecast reuse and the opt-in disk cache that replaced the
first cache (#1219), and add the PRs merged after the backfill: #1221,
#1222, #1223, #1224, #1231, #1232, #1234, #1239 and #1242.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: MateusStano <mateusstano@usp.br>
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