Skip to content

Comments

ENH: Add RLE support for ZCORN#1487

Merged
alifbe merged 1 commit intomainfrom
rle-zcorn
Jan 5, 2026
Merged

ENH: Add RLE support for ZCORN#1487
alifbe merged 1 commit intomainfrom
rle-zcorn

Conversation

@alifbe
Copy link
Collaborator

@alifbe alifbe commented Jan 1, 2026

Resolves #1486

Add support for ZCORN keyword to Run-Length Encoding compression. This is particularly useful for horizontal grid

Checklist

  • Tests added (if not, comment why)
  • Test coverage equal or up from main (run pytest with --cov=src/ --cov-report term-missing)
  • If not squash merging, every commit passes tests
  • Appropriate commit prefix and precise commit message used
  • All debug prints and unnecessary comments removed
  • Docstrings are correct and updated
  • Documentation is updated, if necessary
  • Latest main rebased/merged into branch
  • Added comments on this PR where appropriate to help reviewers
  • Moved issue status on project board
  • Checked the boxes in this checklist ✅

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 adds Run-Length Encoding (RLE) compression support for the ZCORN keyword when exporting grid data to GRDECL format. Previously, RLE compression was only available for the ACTNUM keyword. This enhancement is particularly beneficial for horizontal grids where ZCORN values have many consecutive repetitions.

Key Changes:

  • Extended RLE compression to include ZCORN in addition to ACTNUM
  • Updated test validation to verify compression works correctly for both ZCORN and ACTNUM keywords
  • Improved test robustness with a helper function to parse specific keyword sections

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/xtgeo/grid3d/_grdecl_grid.py Modified the RLE condition to include "ZCORN" alongside "ACTNUM" for compression
tests/test_grid3d/test_grid_property.py Enhanced test validation with section-specific token parsing and verification of ZCORN compression

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alifbe alifbe merged commit e120aa3 into main Jan 5, 2026
38 checks passed
@alifbe alifbe deleted the rle-zcorn branch January 5, 2026 11:29
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.

Allow ZCORN in rle compression when writing grdecl file

2 participants