Skip to content

Fix #606: Follow-ups from Combine distributed fix (yherin/fix-distrib...#624

Merged
nasaul merged 1 commit intoNixtla:mainfrom
JiwaniZakir:fix/606-follow-ups-from-combine-distributed-fix
Apr 16, 2026
Merged

Fix #606: Follow-ups from Combine distributed fix (yherin/fix-distrib...#624
nasaul merged 1 commit intoNixtla:mainfrom
JiwaniZakir:fix/606-follow-ups-from-combine-distributed-fix

Conversation

@JiwaniZakir
Copy link
Copy Markdown
Contributor

Closes #606

Description

Addresses follow-up items from #579 (distributed combine fix):

Test coverage gaps fixed:

  • test_combine_stack (tests/test_lag_transforms.py): Added a numerical correctness assertion using np.testing.assert_allclose to verify that Combine.stack([tfm1]).update(grouped_array) matches tfm1.update(grouped_array) directly, not just structural checks on isinstance and operator.
  • test_nested_combine_take (tests/test_lag_transforms.py): Added a numerical correctness assertion that reconstructs the subset GroupedArray from the taken indices and compares subset_tfm.update(subset_ga) against a freshly-fitted equivalent Combine transform on the same data, ensuring take() produces numerically correct state.

Minor efficiency fix:

  • Combine.stack() (mlforecast/lag_transforms.py): Replaced copy.deepcopy(transforms[0]) with copy.copy(transforms[0]), since out.tfm1 and out.tfm2 are immediately overwritten by their own .stack() calls. The deep copy of those two attributes was unconditionally wasted work.

Checklist:

  • This PR has a meaningful title and a clear description.
  • The tests pass.
  • All linting tasks pass.
  • The notebooks are clean.

This PR was created with AI assistance (Claude). The changes were reviewed by quality gates and a critic model before submission.

Use copy.copy in Combine.stack since tfm1 and tfm2 are immediately
overwritten, avoiding unnecessary deep copies of those attributes.
Add assert_allclose checks to test_combine_stack and
test_nested_combine_take to verify numerical correctness.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 16, 2026

Merging this PR will not alter performance

✅ 12 untouched benchmarks


Comparing JiwaniZakir:fix/606-follow-ups-from-combine-distributed-fix (54fdd88) with main (6e66d2f)

Open in CodSpeed

Copy link
Copy Markdown
Contributor

@nasaul nasaul left a comment

Choose a reason for hiding this comment

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

Great job, thanks for your first contribution.

@nasaul nasaul merged commit 1feeffa into Nixtla:main Apr 16, 2026
21 checks passed
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.

Follow-ups from Combine distributed fix (yherin/fix-distributed-combine-transform)

2 participants