From 0505349ff2c94ceb04d38af9692e04fb5d3a03fe Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Thu, 15 Dec 2022 12:02:34 -0500 Subject: [PATCH] Autodocument ComponentSelector methods/attributes (#20) * Rename ComponentSelector module. * Document the ComponentSelector directly. --- docs/api.rst | 8 +++++++- .../{ComponentSelector.py => component_selector.py} | 0 tedana/selection/selection_nodes.py | 4 ++-- tedana/selection/selection_utils.py | 10 +++++----- tedana/selection/tedica.py | 4 ++-- 5 files changed, 16 insertions(+), 10 deletions(-) rename tedana/selection/{ComponentSelector.py => component_selector.py} (100%) diff --git a/docs/api.rst b/docs/api.rst index 6e72d913a..155d7ad71 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -122,12 +122,18 @@ API :toctree: generated/ :template: module.rst - tedana.selection.ComponentSelector + tedana.selection.component_selector tedana.selection.selection_nodes tedana.selection.selection_utils tedana.selection.tedica tedana.selection.tedpca +.. autosummary:: + :toctree: generated/ + :template: class.rst + + tedana.selection.component_selector.ComponentSelector + .. _api_gscontrol_ref: ********************************************** diff --git a/tedana/selection/ComponentSelector.py b/tedana/selection/component_selector.py similarity index 100% rename from tedana/selection/ComponentSelector.py rename to tedana/selection/component_selector.py diff --git a/tedana/selection/selection_nodes.py b/tedana/selection/selection_nodes.py index 542d65bae..20fc251ca 100644 --- a/tedana/selection/selection_nodes.py +++ b/tedana/selection/selection_nodes.py @@ -27,7 +27,7 @@ decision_docs = { "selector": """\ -selector: :obj:`tedana.selection.ComponentSelector` +selector: :obj:`tedana.selection.component_selector.ComponentSelector` The selector to perform decision tree-based component selection with.""", "ifTrueFalse": """\ ifTrue: :obj:`str` @@ -62,7 +62,7 @@ tag_ifFalse: :obj:`str` The classification tag to apply if a component is classified False. Default="".""", "basicreturns": """\ -selector: :obj:`tedana.selection.ComponentSelector` +selector: :obj:`tedana.selection.component_selector.ComponentSelector` If only_used_metrics is False, the updated selector is returned used_metrics: :obj:`set(str)` If only_used_metrics is True, the names of the metrics used in the diff --git a/tedana/selection/selection_utils.py b/tedana/selection/selection_utils.py index a947eb16a..4e946108d 100644 --- a/tedana/selection/selection_utils.py +++ b/tedana/selection/selection_utils.py @@ -24,7 +24,7 @@ def selectcomps2use(selector, decide_comps): Parameters ---------- - selector: :obj:`tedana.selection.ComponentSelector` + selector: :obj:`tedana.selection.component_selector.ComponentSelector` Only uses the component_table in this object decide_comps: :obj:`str` or :obj:`list[str]` or :obj:`list[int]` This is string or a list of strings describing what classifications @@ -104,7 +104,7 @@ def change_comptable_classifications( Parameters ---------- - selector: :obj:`tedana.selection.ComponentSelector` + selector: :obj:`tedana.selection.component_selector.ComponentSelector` The attributes used are component_table, component_status_table, and current_node_idx ifTrue, ifFalse: :obj:`str` @@ -127,7 +127,7 @@ def change_comptable_classifications( Returns ------- - selector: :obj:`tedana.selection.ComponentSelector` + selector: :obj:`tedana.selection.component_selector.ComponentSelector` component_table["classifications"] will reflect any new classifications. component_status_table will have a new column titled @@ -184,7 +184,7 @@ def comptable_classification_changer( Parameters ---------- - selector: :obj:`tedana.selection.ComponentSelector` + selector: :obj:`tedana.selection.component_selector.ComponentSelector` The attributes used are component_table, component_status_table, and current_node_idx boolstate : :obj:`bool` @@ -211,7 +211,7 @@ def comptable_classification_changer( warning is suppressed. default=False Returns ------- - selector: :obj:`tedana.selection.ComponentSelector` + selector: :obj:`tedana.selection.component_selector.ComponentSelector` Operates on the True OR False components depending on boolstate component_table["classifications"] will reflect any new classifications. diff --git a/tedana/selection/tedica.py b/tedana/selection/tedica.py index 3331136f4..5388522a9 100644 --- a/tedana/selection/tedica.py +++ b/tedana/selection/tedica.py @@ -4,7 +4,7 @@ import logging from tedana.metrics import collect -from tedana.selection.ComponentSelector import ComponentSelector +from tedana.selection.component_selector import ComponentSelector LGR = logging.getLogger("GENERAL") RepLGR = logging.getLogger("REPORT") @@ -25,7 +25,7 @@ def automatic_selection(component_table, n_echos, n_vols, tree="kundu"): Returns ------- - selector: :obj:`tedana.selection.ComponentSelector` + selector: :obj:`tedana.selection.component_selector.ComponentSelector` Contains component classifications in a component_table and provenance and metadata from the component selection process