Skip to content

feat(datacube): deterministic dimension ordering in from_datacube#107

Merged
mathleur merged 1 commit into
mainfrom
feat/deterministic-datacube
Jul 10, 2026
Merged

feat(datacube): deterministic dimension ordering in from_datacube#107
mathleur merged 1 commit into
mainfrom
feat/deterministic-datacube

Conversation

@HCookie

@HCookie HCookie commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

Makes from_datacube produce deterministic tree structure regardless of HashMap iteration order.

Problem

Previously, dimensions not specified in the order parameter were iterated from the HashMap in arbitrary order, meaning the same datacube could produce different tree structures across runs.

Solution

  • When order is None: all dimensions are sorted alphabetically.
  • When order is Some: specified dimensions come first in order, remaining dimensions are appended alphabetically.

Tests

  • from_datacube_with_explicit_order: verifies explicit ordering is respected
  • from_datacube_no_order_falls_back_to_alphabetical: verifies alphabetical default
  • from_datacube_partial_order_appends_remaining_alphabetically: verifies hybrid case

Part of the split from #102. Independently mergeable.

- from_datacube now sorts remaining (unordered) dimensions alphabetically
  for deterministic tree structure
- When order is provided, unlisted dimensions are appended in sorted order
- When order is None, all dimensions are sorted alphabetically
- Add unit tests for explicit, no-order, and partial-order cases
@mathleur
mathleur marked this pull request as ready for review July 10, 2026 10:34
@mathleur
mathleur merged commit 0d6534d into main Jul 10, 2026
2 checks passed
@mathleur
mathleur deleted the feat/deterministic-datacube branch July 10, 2026 10:35
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.

2 participants