Skip to content

refactor: extract Dataset._build_pipeline() to eliminate 4x pipeline duplication#85

Merged
maxine-at-forecast merged 2 commits intodevelopfrom
feature/M2KE-5GVB-extract-dataset-build-pipeline-to-eliminate-4x-af25
Apr 1, 2026
Merged

refactor: extract Dataset._build_pipeline() to eliminate 4x pipeline duplication#85
maxine-at-forecast merged 2 commits intodevelopfrom
feature/M2KE-5GVB-extract-dataset-build-pipeline-to-eliminate-4x-af25

Conversation

@maxine-at-forecast
Copy link
Copy Markdown
Contributor

Summary

  • Extract Dataset._build_pipeline() as single source of truth for pipeline construction, replacing 4 duplicated code paths in ordered()/shuffled()
  • Fix bug where batched iteration silently dropped filter()/map() stages — now applied per-sample before batching
  • Add eager ValueError for batch_size < 1 (previously raised cryptic IndexError from WDS internals)

Test plan

  • 4 new tests verify filter/map work with batched ordered/shuffled iteration
  • All 1739 existing tests pass with no regressions
  • Lint clean (ruff check)

Closes CL-L3

🤖 Generated with Claude Code

maxine-at-forecast and others added 2 commits April 1, 2026 13:03
…duplication [CL-L3]

Consolidate the duplicated pipeline construction from ordered() and
shuffled() (4 code paths) into a single _build_pipeline() method.

Fix bug where batched iteration silently dropped filter/map stages —
filter and map are now always applied per-sample before batching.

Add eager validation for batch_size < 1 (previously raised a cryptic
IndexError from WDS internals).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@maxine-at-forecast maxine-at-forecast merged commit fe2669b into develop Apr 1, 2026
8 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.

1 participant