Create an efficient `all_subtypes` function
- Dominant language
- Python
- Stars
- 253
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
Getting all subtypes of a certain type in the data store is used in multiple places ([1](https://github.com/asyml/forte/pull/771#discussion_r880779359), [2](https://github.com/asyml/forte/pull/769#discussion_r880809181)), but could be implemented inefficiently and can be wrong. We should create one single function for this.
**Describe the solution you'd like**
The solution should consider:
1. Caching results so get subtype won't be doing the same thing repeatedly
2. Make sure the subtype orders and everything is the same across different calls (sorting the output)
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
- This is part of the data efficiency project
- This PR should be made to the `master` branch.
- After the data tuple class is finished, we may switch to a new branch for integration.
Contributor guide
Research direction
Start by locating the existing subtype lookups in the data-store code and review the behavior discussed in PRs 771 and 769. Define the shared function's caching and deterministic ordering requirements, then verify that repeated calls return the same sorted results without redundant subtype work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100