Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Styling issues and make RTD build work #968

Merged
merged 3 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Paper = "https://joss.theoj.org/papers/10.21105/joss.03669"

[project.optional-dependencies]
doc = [
"sphinx>=1.5.3",
"sphinx>=6.2.1",
"sphinx_copybutton",
"sphinx_rtd_theme",
"sphinx_rtd_theme>=1.2.2",
"sphinx-argparse",
"sphinxcontrib-bibtex",
]
Expand Down
8 changes: 4 additions & 4 deletions tedana/selection/selection_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ def selectcomps2use(selector, decide_comps):
"selector.component_table needs a 'classification' column to run selectcomp2suse"
)

if (type(decide_comps) == str) or (type(decide_comps) == int):
if type(decide_comps) in [str, int]:
decide_comps = [decide_comps]
if (type(decide_comps) == list) and (decide_comps[0] == "all"):
if (type(decide_comps) is list) and (decide_comps[0] == "all"):
# All components with any string in the classification field
# are set to True
comps2use = list(range(selector.component_table.shape[0]))

elif (type(decide_comps) == list) and all(isinstance(elem, str) for elem in decide_comps):
elif (type(decide_comps) is list) and all(isinstance(elem, str) for elem in decide_comps):
comps2use = []
for didx in range(len(decide_comps)):
newcomps2use = selector.component_table.index[
selector.component_table["classification"] == decide_comps[didx]
].tolist()
comps2use = list(set(comps2use + newcomps2use))
elif (type(decide_comps) == list) and all(type(elem) == int for elem in decide_comps):
elif (type(decide_comps) is list) and all(type(elem) is int for elem in decide_comps):
# decide_comps is already a string of indices
if len(selector.component_table) <= max(decide_comps):
raise ValueError(
Expand Down
4 changes: 2 additions & 2 deletions tedana/workflows/ica_reclassify.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ def _parse_manual_list(manual_list):
elif op.exists(op.expanduser(str(manual_list[0]).strip(" "))):
# filename was given
manual_nums = fname_to_component_list(op.expanduser(str(manual_list[0]).strip(" ")))
elif type(manual_list[0]) == str:
elif type(manual_list[0]) is str:
# arbitrary string was given, length of list is 1
manual_nums = str_to_component_list(manual_list[0])
elif type(manual_list[0]) == int:
elif type(manual_list[0]) is int:
# Is a single integer and should remain a list with a single integer
manual_nums = manual_list
else:
Expand Down