Skip to content

Add dataarray size details to merge errors#106

Open
pragnyanramtha wants to merge 1 commit into
mllam:mainfrom
pragnyanramtha:fix-105-merge-error-shapes
Open

Add dataarray size details to merge errors#106
pragnyanramtha wants to merge 1 commit into
mllam:mainfrom
pragnyanramtha:fix-105-merge-error-shapes

Conversation

@pragnyanramtha

Copy link
Copy Markdown

Problem summary
create_dataset reports a generic merge failure when target data arrays cannot align, but it does not show the per-target sizes that explain mismatched coordinates.

Root cause
The error path only included merged coordinate dumps, which make it hard to compare original input data arrays by target.

Files changed

  • mllam_data_prep/create_dataset.py
  • tests/test_dataset.py

Tests run

  • python -m pytest tests/test_dataset.py::test_merge_error_includes_dataarray_sizes_by_target -q
  • python -m pytest tests/test_dataset.py -q

Risk notes
Low risk. The change only adds detail to an existing invalid-config exception path and keeps successful merge behavior unchanged.

Closes #105

@pragnyanramtha pragnyanramtha marked this pull request as ready for review May 13, 2026 18:58
Copilot AI review requested due to automatic review settings May 13, 2026 18:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds per-target DataArray size details to the InvalidConfigException raised when _merge_dataarrays_by_target fails, making mismatched dimensions easier to diagnose. Also adds a unit test that triggers the error path and verifies the formatted output.

Changes:

  • New helper _format_dataarray_sizes_by_target builds a multi-line summary of dims/sizes per target.
  • The merge failure exception message now includes the formatted size summary.
  • Added test_merge_error_includes_dataarray_sizes_by_target covering the new error content.

Reviewed changes

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

File Description
mllam_data_prep/create_dataset.py Adds size-summary helper and includes it in the merge-failure exception message.
tests/test_dataset.py Adds a test asserting the new size details appear in the exception message.

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

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.

Add more helpful exception message when per-target data-array merge fails.

2 participants