Skip to content

Conversation

@larsevj
Copy link
Collaborator

@larsevj larsevj commented Jan 13, 2026

Issue
Resolves #my_issue

Approach
Short description of the approach

(Screenshot of new behavior in GUI if applicable)

  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure unit tests pass locally after every commit (git rebase -i main --exec 'just rapid-tests')

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Add backport label to latest release (format: 'backport release-branch-name')

@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.52%. Comparing base (127ef22) to head (9bd9179).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12627      +/-   ##
==========================================
- Coverage   90.54%   90.52%   -0.02%     
==========================================
  Files         435      435              
  Lines       30014    30018       +4     
==========================================
  Hits        27175    27175              
- Misses       2839     2843       +4     
Flag Coverage Δ
cli-tests 37.29% <65.11%> (+0.02%) ⬆️
gui-tests 68.73% <60.46%> (+0.02%) ⬆️
performance-and-unit-tests 73.88% <100.00%> (-0.01%) ⬇️
test 38.06% <51.16%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 13, 2026

Merging this PR will not alter performance

✅ 22 untouched benchmarks


Comparing larsevj:update_polars_2 (9bd9179) with main (127ef22)

Open in CodSpeed

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the upper bound constraint on the polars dependency (previously pinned to <1.35), allowing the project to use polars v2. The changes include necessary API migrations and refactoring to maintain compatibility with the newer polars version.

Changes:

  • Unpinned polars version constraint in pyproject.toml (from >=1.32.3, <1.35 to >=1.32.3)
  • Migrated deprecated polars APIs (map_elements to expression-based operations and map_batches)
  • Vectorized distribution transform functions to handle both scalar and array inputs using numpy operations

Reviewed changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pyproject.toml Removed upper bound constraint on polars dependency
uv.lock Updated lock file with polars 1.37.1 and polars-runtime-32 1.37.1, jupyterlab 4.5.2
tests/ert/unit_tests/config/test_gen_kw_config.py Added warning filter for expected numpy overflow warning in lognormal test
tests/ert/ui_tests/cli/test_field_parameter.py Migrated from map_elements to expression-based polars operations (pl.when, pl.sum_horizontal, pl.max_horizontal); added column reordering logic for robust DataFrame comparison
tests/ert/ui_tests/cli/snapshots/test_field_parameter/.../enif_heat_snapshot.csv Updated snapshot data reflecting polars v2 behavior
src/ert/storage/local_ensemble.py Migrated map_elements to map_batches with proper Series-to-numpy conversion; improved isinstance check for numpy integers
src/ert/config/rft_config.py Added empty array check to prevent DataFrame construction issues
src/ert/config/parameter_config.py Updated type hints for transform_data() to support FloatOrArray
src/ert/config/gen_kw_config.py Updated type hints and imports for FloatOrArray support
src/ert/config/distribution.py Vectorized all transform functions to support both scalar and array inputs using numpy operations; changed from math module to numpy for consistency

@xjules xjules added this to SCOUT Jan 16, 2026
@xjules xjules moved this to Ready for Review in SCOUT Jan 16, 2026
@frode-aarstad
Copy link
Contributor

Is this ready for review?

@larsevj larsevj marked this pull request as ready for review January 16, 2026 12:27
@larsevj larsevj marked this pull request as draft January 20, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

3 participants