Skip to content

Keep the order of NDCollection.aligned_axis_physical_types stable - #983

Open
nabobalis wants to merge 3 commits into
sunpy:mainfrom
nabobalis:fix-aligned-physical-types-order
Open

nabobalis wants to merge 3 commits into
sunpy:mainfrom
nabobalis:fix-aligned-physical-types-order

Conversation

@nabobalis

@nabobalis nabobalis commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

PR Description

NDCollection.aligned_axis_physical_types built each tuple from a set, so the order of the physical types changed with Python's hash seed. Printing a collection, or anything else that shows these types (such as downstream docs), gave different output from run to run.

AI Assistance Disclosure

AI tools were used for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding
  • No AI tools were used

Regardless of AI use, the human contributor remains fully responsible for correctness, design choices, licensing compatibility, and long-term maintainability.

K.

Each tuple was built from a set of strings, so its order changed with Python's
hash seed and printing a collection gave different output from run to run.
The common types now keep the order of the first member.
@nabobalis nabobalis closed this Sep 28, 2026
@nabobalis nabobalis reopened this Sep 28, 2026
@nabobalis

Copy link
Copy Markdown
Member Author

This one is a pain for doctests.

This branch has not been deployed

No deployments
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