Skip to content

fix: add null_class_id override to SemanticSegmentationLabelSource - #2329

Open
Pranava-Kumar wants to merge 1 commit into
azavea:masterfrom
Pranava-Kumar:fix/null-class-override
Open

fix: add null_class_id override to SemanticSegmentationLabelSource#2329
Pranava-Kumar wants to merge 1 commit into
azavea:masterfrom
Pranava-Kumar:fix/null-class-override

Conversation

@Pranava-Kumar

Copy link
Copy Markdown

Summary

Fixes #2326 by adding an optional null_class_id parameter to SemanticSegmentationLabelSource.__init__ that overrides class_config.null_class_id. Also fixes the outdated docstring that referenced a null_class_id parameter that didn't exist in the signature.

Changes

  • semantic_segmentation_label_source.py: Added null_class_id: int | None = None parameter to __init__. Exposed via a null_class_id property that falls back to class_config.null_class_id when not set. Updated get_label_arr to use the lazy property. Fixed docstring to accurately describe all parameters.
  • test_semantic_segmentation_label_source.py: Added 3 tests — default behavior, explicit override, and override used for off-edge padding.

Backward Compatibility

Fully backward compatible. When null_class_id is None (default), behavior is identical to the current implementation. The lazy property approach means class_config.null_class_id is only evaluated when actually needed (off-edge windows), preserving the original lazy evaluation pattern.

Closes #2326.

Adds an optional null_class_id parameter to __init__ that overrides
class_config.null_class_id. Falls back to class_config.null_class_id
when not provided. Also fixes the outdated docstring that mentioned a
null_class_id parameter that didn't exist in the signature.

Closes azavea#2326.
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.

Bug: SemanticSegmentationLabelSource ignores null_class configuration for no-data pixels

1 participant