Skip to content

Improves get_channels#5

Merged
sagar87 merged 1 commit into
mainfrom
feature/202302_make_get_channels_more_robust
Feb 6, 2023
Merged

Improves get_channels#5
sagar87 merged 1 commit into
mainfrom
feature/202302_make_get_channels_more_robust

Conversation

@timtreis

@timtreis timtreis commented Feb 5, 2023

Copy link
Copy Markdown
Member

Needs more unti tests, don't merge yet

@timtreis timtreis self-assigned this Feb 5, 2023
@timtreis timtreis requested a review from sagar87 February 5, 2023 17:30
@sagar87 sagar87 marked this pull request as ready for review February 6, 2023 12:59
@sagar87 sagar87 merged commit 590f276 into main Feb 6, 2023
@timtreis timtreis deleted the feature/202302_make_get_channels_more_robust branch February 21, 2023 13:08
timtreis added a commit that referenced this pull request Jun 9, 2026
- #1 no-clobber: a populated obsm["spatial"] (reader- or prior-call-provided)
  is no longer overwritten — warn and skip that element's centroids. Coords
  stay in the element's intrinsic pixel space (documented); area/diameter
  still overwrite our own columns. Restores the per-element finiteness guard.
- #2 unmatched instance ids: instances annotated in the table but absent from
  the element (e.g. str-vs-int id dtype mismatch) now warn instead of silently
  writing NaN.
- #3 float-dtype labels: the dense relabelling bincounts integer searchsorted
  indices, never the raw labels, so a float-typed (integer-valued) mask no
  longer crashes np.bincount.
- #4 atomic writes: validate every obs target (non-numeric column collision)
  before the first mutation, so a bad column never leaves a half-written table.
- #5 O(n_labels) memory: relabel labels to a dense 0..k-1 range, so the
  aggregator's memory scales with the number of distinct labels, not the
  maximum label id (sparse/global ids no longer blow it up). Single max() pass
  replaced by a unique() pass; same pass count.
- #7 circle area: dispatch on geometry TYPE (all-Point) rather than the
  presence of a "radius" column, so a polygon element carrying a radius column
  uses geometry.area, not pi*r**2.

Tests updated to the new contract and extended for each fix.
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.

2 participants