Skip to content

Wrote two Collection-related utility functions - #234

Open
navyacodes wants to merge 8 commits into
mainfrom
jain-fu/list-utilities
Open

Wrote two Collection-related utility functions#234
navyacodes wants to merge 8 commits into
mainfrom
jain-fu/list-utilities

Conversation

@navyacodes

Copy link
Copy Markdown
Contributor

Estimated time to review: small

Description of changes:

  • added a function collectionFraction which compares the fraction of elements in one Collection to another
  • added a function asCollection which converts Bags to Collections
  • wrote tests for both methods

Brief justification of changes:
When a stem cell divides, we need to determine what fraction of the apical and basal voxel sets each daughter cell inherits, since this determines how much Deadpan/Prospero each daughter gets. collectionFraction provides a way to compute the overlap fraction between two Collection objects, and asCollection supports this by converting Bags to Collection objects.

@navyacodes navyacodes self-assigned this Aug 10, 2026
@navyacodes
navyacodes marked this pull request as ready for review August 10, 2026 20:27
@navyacodes navyacodes added priority: medium Non-urgent but important task package: core Related to the core package category: util Related to the util subpackages labels Aug 10, 2026
@navyacodes
navyacodes requested review from a team, Jannetty, allison-li-1016, cainja, jacob-evarts, jessicasyu, kristaphommatha and pohaoc2 and removed request for a team August 10, 2026 20:27
Comment thread src/arcade/core/util/Utilities.java
Comment thread src/arcade/core/util/Utilities.java Outdated
Comment thread src/arcade/core/util/Utilities.java Outdated
Comment thread src/arcade/core/util/Utilities.java Outdated
Comment thread src/arcade/core/util/Utilities.java Outdated

@allison-li-1016 allison-li-1016 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Everything else looks good to me -- maybe just consider the comment about forcing the denominator collection to be the longer one

Comment thread src/arcade/core/util/Utilities.java
Comment thread src/arcade/core/util/Utilities.java Outdated
Comment thread src/arcade/core/util/Utilities.java Outdated
Comment thread src/arcade/core/util/Utilities.java Outdated
Comment thread src/arcade/core/util/Utilities.java Outdated

@kristaphommatha kristaphommatha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: util Related to the util subpackages package: core Related to the core package priority: medium Non-urgent but important task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants