tedana
tedana copied to clipboard
Add check of a component metric is used that includes n/a values
Summary
It is possible to use metrics in the component table that have n/a or None values for some components. With the added decision tree modularization #756, if a conditional statement test includes components with n/a values then the result will always be False
A check to throw an error rather than returning False
should be added. While this could be considerd a bug, this is not an urgent problem because this scenario is impossible with the decision trees that are included with tedana.
Additional Detail
The kundu decision tree calculate a few metrics on a subset of components and then classifies components within that subset. The minimal tree doesn't add components so this issue can never arise there.
One potential way to address this issue is to add used_metrics
as a parameter into selectcomps2use
. Then, after the selected components are identified, if n/a
or None
are the values for any of the used_metrics, an error should be returned. Tree should be designed so that this is impossible, so it's better to throw an error that says there's a problem with a decision tree.
Next Steps
- Decide where to prioritize this.