Merged
Conversation
This was referenced Nov 24, 2025
kmitcham
approved these changes
Nov 25, 2025
SeanDuHare
approved these changes
Nov 25, 2025
toloudis
reviewed
Nov 28, 2025
bioio_base/types.py
Outdated
|
|
||
| value: Optional[float] | ||
| type: Optional[str] | ||
| unit: Optional[str] |
Contributor
There was a problem hiding this comment.
I have a few questions about the value, type, unit design here.
- can we put some actual typing on
unit? (check with what OME advocates, or pick a well used python units library). Or do we want to just allow any old unit whatsoever? - If we have typed units, then I would think about whether you might want to distinguish "unitless" (like for channels) vs
None? Could there be a warning for when a reader finds an unexpected/unrecognized unit?) - can we put some typing on
type? For this it seems that the OME dimension types are what is expected here. valueis not explained very well in the docstring. What is thevalueof a DimensionProperty? Is it the scaling from the multiscale transform? In other words, is it the number ofunitunits in one pixel of this dimension? If so, then it changes depending on what multiresolution level is selected and we might want to note that in a comment too. Kinda wondering if there's a better word thanvalue. Thinking out loud:unit_scaleperhaps?
Contributor
Author
|
DimensionProperties now only includes |
SeanDuHare
approved these changes
Dec 3, 2025
| "ome-types[pint]>=0.2", | ||
| "pint", # for typing units | ||
| "xarray>=2022.6.0", | ||
|
|
kmitcham
approved these changes
Dec 3, 2025
toloudis
approved these changes
Dec 4, 2025
|
|
||
| @property | ||
| @abstractmethod | ||
| def dimension_properties(self) -> DimensionProperties: |
Contributor
There was a problem hiding this comment.
I don't love "properties" in the names here, but the only things I can think of that make it better are words like "metadata" or "info" which aren't a huge step up. Maybe dimension_info is a little better than dimension_properties? idk...
| "numpy>=1.21.0", | ||
| "ome-types>=0.2", | ||
| "ome-types[pint]>=0.2", | ||
| "pint", # for typing units |
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.
Description
The purpose of this PR is to start to resolve #bioio-devs/bioio#25 It adds a new property
dimension_propertieswhich allows subsequent readers to attachtypeandunitsto dimension metadata. The idea was to keepScaleandPhysicalPixelSizeintact and allow for a new property to provide more comprehensive (yet harder to access) information. At a default level thedimesion_propertieswill only contain the information already found inscale.