Fix #606: Follow-ups from Combine distributed fix (yherin/fix-distrib...#624
Merged
nasaul merged 1 commit intoNixtla:mainfrom Apr 16, 2026
Conversation
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]>
nasaul
approved these changes
Apr 16, 2026
Contributor
nasaul
left a comment
There was a problem hiding this comment.
Great job, thanks for your first contribution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 usingnp.testing.assert_allcloseto verify thatCombine.stack([tfm1]).update(grouped_array)matchestfm1.update(grouped_array)directly, not just structural checks onisinstanceandoperator.test_nested_combine_take(tests/test_lag_transforms.py): Added a numerical correctness assertion that reconstructs the subsetGroupedArrayfrom the taken indices and comparessubset_tfm.update(subset_ga)against a freshly-fitted equivalentCombinetransform on the same data, ensuringtake()produces numerically correct state.Minor efficiency fix:
Combine.stack()(mlforecast/lag_transforms.py): Replacedcopy.deepcopy(transforms[0])withcopy.copy(transforms[0]), sinceout.tfm1andout.tfm2are immediately overwritten by their own.stack()calls. The deep copy of those two attributes was unconditionally wasted work.Checklist:
This PR was created with AI assistance (Claude). The changes were reviewed by quality gates and a critic model before submission.