Skip to content

Labels: prefer the smallest integer type; note on the 2^53 limit and negative values - #101

Open
jan-glx wants to merge 1 commit into
storage-formatfrom
jangleixner/label-dtype-range
Open

jan-glx wants to merge 1 commit into
storage-formatfrom
jangleixner/label-dtype-range

Conversation

@jan-glx

@jan-glx jan-glx commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Storage-format side of the label value recommendations (data-model side: #100).

Changes

Labels → Arrays:

  • New writer recommendation: "Writers SHOULD use the smallest integer type of the chosen signedness that holds all values." spatialdata's rasterize already does this from uint16 on (fix: support raster labels above uint16 spatialdata#1167); Labels2DModel.parse and Labels3DModel.parse keep the type they are given.
  • Implementation note, new paragraph: why label values should stay below 253 (the data model's recommendation): where labels pass through float64, and what rasterize and parse do.
  • Implementation note, negative values: the list of functions that fail on them (which would age) is replaced by a link to Support negative label values spatialdata#1329, which tracks them; adds that negative values should likewise be greater than −253.

No requirement changes: existing stores stay valid and no version changes.

This branch was successfully deployed

1 active deployment
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