Add ModalityCombinationsUtil for building modality combination sets#225
Add ModalityCombinationsUtil for building modality combination sets#225sarthak-19 wants to merge 1 commit intoWordPress:trunkfrom
ModalityCombinationsUtil for building modality combination sets#225Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #225 +/- ##
============================================
+ Coverage 88.12% 88.16% +0.03%
- Complexity 1213 1217 +4
============================================
Files 60 61 +1
Lines 3934 3945 +11
============================================
+ Hits 3467 3478 +11
Misses 467 467
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Adds a new static utility class
ModalityCombinationsUtilundersrc/Messages/Util/that generates all valid modality combinations from a set of required modalities and a set of optional modalities.This reduces repetitive, error-prone manual array declarations that provider implementations currently need when registering which input/output modality combinations their models support.
How it works
Uses binary bitmask enumeration to produce all
2^nsubsets of the optional modalities, each merged with the fixed required modalities. Because modality lists are unordered, subsets (not permutations) are the correct unit — each combination appears exactly once.Usage
Issue :