Skip to content

Add new GeomUnion and GeomIntersection geometry classes - #182

Merged
erykoff merged 5 commits into
mainfrom
multigeom
Oct 22, 2026
Merged

erykoff merged 5 commits into
mainfrom
multigeom

Conversation

@erykoff

@erykoff erykoff commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@fjaviersanchez fjaviersanchez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it would be good to rename the add methods in GeomUnion and GeomIntersection to append, but this is just an opinion and shouldn't prevent the PR from merging. The defragmentation feature is very cool. Thanks a lot!

Comment thread healsparse/geom.py Outdated
return np.stack([out_starts, out_ends], axis=1)


hpg.pixel_ranges_union = pixel_ranges_union

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a hpgeom version check here? I guess it shouldn't matter, but just in case the implementations diverge?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I'm going to make an hpgeom release and make that lower-limit for healsparse to keep them in sync. I'm also going to remove these temporary copies from healsparse (they are flagged DO NOT MERGE)

Comment thread healsparse/geom.py Outdated
else:
return hpg.pixel_ranges_to_pixels(pixel_ranges)

def add(self, geom):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change to append since add might be confusing with the sum operation?

Comment thread healsparse/geom.py Outdated
else:
return hpg.pixel_ranges_to_pixels(pixel_ranges)

def add(self, geom):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as with the intersection -- maybe use append rather than add?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense. I'll make that change.

@erykoff
erykoff merged commit b19002c into main Oct 22, 2026
5 checks passed
@erykoff
erykoff deleted the multigeom branch October 22, 2026 23:36
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