Skip to content

ENH: Create ensembles from user-defined profiles - #1141

Open
ting-hong-shieh wants to merge 1 commit into
RocketPy-Team:developfrom
ting-hong-shieh:codex/enh-environment-create-ensemble-604
Open

ENH: Create ensembles from user-defined profiles#1141
ting-hong-shieh wants to merge 1 commit into
RocketPy-Team:developfrom
ting-hong-shieh:codex/enh-environment-create-ensemble-604

Conversation

@ting-hong-shieh

Copy link
Copy Markdown

Closes #604.

Pull request type

  • Code changes (bugfix, features)
  • ReadMe, Docs and GitHub updates

Checklist

  • Tests for the changes have been added
  • Docs have been reviewed and updated
  • Ruff and Pylint pass locally
  • CHANGELOG.md — no action needed; an LLM workflow auto-updates it after merge

Current behavior

Environment can load ensemble weather files, but users cannot combine their own atmospheric profiles into the NetCDF layout expected by the ensemble loader.

New behavior

Environment.create_ensemble accepts two or more user-defined pressure, temperature, eastward-wind and northward-wind profiles for one location. It:

  • validates each member and determines a common pressure grid;
  • interpolates temperature and wind onto that grid;
  • writes a CF-annotated, GEFS-compatible NetCDF file;
  • loads the file and activates member 0; and
  • preserves the file for later use with type="Ensemble" and dictionary="GEFS".

The loader now also reports a zero-hour interval for static datasets that contain one valid time.

Breaking change

  • No

Verification

  • pytest tests/unit/environment -q — 163 passed, 6 skipped
  • ruff check rocketpy/environment/environment.py rocketpy/environment/tools.py tests/unit/environment/test_environment.py
  • pylint rocketpy/environment/environment.py rocketpy/environment/tools.py tests/unit/environment/test_environment.py — 10.00/10
  • Sphinx warnings-as-errors build for the ensemble documentation page

@ting-hong-shieh
ting-hong-shieh marked this pull request as ready for review August 13, 2026 04:24
@ting-hong-shieh
ting-hong-shieh requested a review from a team as a code owner August 13, 2026 04:24
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