add loaders#9
Open
MikeLippincott wants to merge 2 commits intoWayScience:mainfrom
Open
Conversation
d33bs
requested changes
Apr 23, 2026
d33bs
approved these changes
Apr 30, 2026
Member
d33bs
left a comment
There was a problem hiding this comment.
Great job - thanks for addressing the changes! I feel this LGTM.
| def _coerce_dataframe_column_names_to_strings( | ||
| dataframe: pandas.DataFrame, | ||
| ) -> pandas.DataFrame: | ||
| """Ensure DataFrame column labels are string-typed before writing.""" |
Member
There was a problem hiding this comment.
For this and other functions consider documenting all parameters and return types.
Comment on lines
+45
to
+61
| FEATURE_OUTPUT_SCHEMA = pa.DataFrameSchema( | ||
| columns={}, | ||
| strict=False, | ||
| parsers=[pa.Parser(_coerce_dataframe_column_names_to_strings)], | ||
| ) | ||
|
|
||
|
|
||
| FEATURE_NAME_COMPONENT_SCHEMA = pa.DataFrameSchema( | ||
| columns={ | ||
| "compartment": pa.Column(object, nullable=False, coerce=True), | ||
| "channel": pa.Column(object, nullable=False, coerce=True), | ||
| "feature_type": pa.Column(object, nullable=False, coerce=True), | ||
| "measurement": pa.Column(object, nullable=False, coerce=True), | ||
| }, | ||
| strict=True, | ||
| parsers=[pa.Parser(_coerce_feature_name_components)], | ||
| ) |
Member
There was a problem hiding this comment.
Consider moving all globals to the top of the module.
| return string | ||
|
|
||
|
|
||
| @beartype |
| numpy.ndarray | ||
| Image returned | ||
| """ | ||
| image = bioio.BioImage(str(image_path)) # selects the first scene found |
Member
There was a problem hiding this comment.
Instead of relying on this thin function could you rely on the bioio method directly where needed? This might save you the strain of needing to maintain this.
| Image returned | ||
| """ | ||
| image = bioio.BioImage(str(image_path)) # selects the first scene found | ||
| return image.get_image_data("ZYX") |
Member
There was a problem hiding this comment.
Should this be configurable in terms of dimensions where applied?
| """Test creating FeatureMetadata instance.""" | ||
| metadata = FeatureMetadata( | ||
| compartment="nucleus", | ||
| @pytest.mark.parametrize( |
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
This PR adds the loaders needed for ZedProfiler's featurization process
What kind of change(s) are included?
Checklist
Please ensure that all boxes are checked before indicating that this pull request is ready for review.