Skip to content

Commit

Permalink
Reformat with new version of black (#1020)
Browse files Browse the repository at this point in the history
* Run new version of black.

* Run isort.
  • Loading branch information
tsalo authored Feb 7, 2024
1 parent b6c53fc commit f9551a9
Show file tree
Hide file tree
Showing 34 changed files with 45 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

from github_link import make_linkcode_resolve


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down Expand Up @@ -55,9 +54,10 @@
"sphinxcontrib.bibtex", # for foot-citations
]

import sphinx
from distutils.version import LooseVersion

import sphinx

if LooseVersion(sphinx.__version__) < LooseVersion("1.4"):
extensions.append("sphinx.ext.pngmath")
else:
Expand Down
5 changes: 3 additions & 2 deletions docs/sphinxext/github_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
This script comes from scikit-learn:
https://github.com/scikit-learn/scikit-learn/blob/main/doc/sphinxext/github_link.py
"""
from operator import attrgetter

import inspect
import subprocess
import os
import subprocess
import sys
from functools import partial
from operator import attrgetter

REVISION_CMD = "git rev-parse --short HEAD"

Expand Down
1 change: 1 addition & 0 deletions tedana/bibtex.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for managing the tedana bibliography."""

import logging
import os.path as op
import re
Expand Down
1 change: 1 addition & 0 deletions tedana/combine.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to optimally combine data across echoes."""

import logging

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tedana/decay.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to estimate S0 and T2* from multi-echo data."""

import logging

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tedana/decomposition/ica.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ICA and related signal decomposition methods for tedana."""

import logging
import warnings

Expand Down
1 change: 1 addition & 0 deletions tedana/decomposition/pca.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""PCA and related signal decomposition methods for tedana."""

import logging
from numbers import Number

Expand Down
1 change: 1 addition & 0 deletions tedana/docs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Documentation to be injected into docstrings."""

import sys

###################################
Expand Down
1 change: 1 addition & 0 deletions tedana/gscontrol.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Global signal control methods."""

import logging

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tedana/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
data sources, assist in writing per-echo verbose outputs, or act as helper
functions for any of the above.
"""

import json
import logging
import os
Expand Down
1 change: 1 addition & 0 deletions tedana/metrics/_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Miscellaneous utility functions for metric calculation."""

import logging

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tedana/metrics/collect.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tools to collect and generate metrics."""

import logging
import os.path as op

Expand Down
1 change: 1 addition & 0 deletions tedana/metrics/dependence.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Metrics evaluating component TE-dependence or -independence."""

import logging

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tedana/reporting/dynamic_figures.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Dynamic figures for tedana report."""

from math import pi

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tedana/reporting/html_report.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Build HTML reports for tedana."""

import logging
import os
import re
Expand Down
1 change: 1 addition & 0 deletions tedana/reporting/static_figures.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to creating figures to inspect tedana output."""

import logging
import os

Expand Down
1 change: 1 addition & 0 deletions tedana/selection/component_selector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Identify and label TE-dependent and TE-independent components."""

import inspect
import logging
import os.path as op
Expand Down
13 changes: 7 additions & 6 deletions tedana/selection/selection_nodes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions that will be used as steps in a decision tree."""

import logging

import numpy as np
Expand Down Expand Up @@ -536,9 +537,9 @@ def dec_variance_lessthan_thresholds(
if custom_node_label:
outputs["node_label"] = custom_node_label
else:
outputs[
"node_label"
] = f"{var_metric}<{single_comp_threshold}. All variance<{all_comp_threshold}"
outputs["node_label"] = (
f"{var_metric}<{single_comp_threshold}. All variance<{all_comp_threshold}"
)

LGR.info(f"{function_name_idx}: {if_true} if {outputs['node_label']}, else {if_false}")
if log_extra_info:
Expand Down Expand Up @@ -1019,9 +1020,9 @@ def dec_classification_doesnt_exist(
if custom_node_label:
outputs["node_label"] = custom_node_label
elif at_least_num_exist == 1:
outputs[
"node_label"
] = f"Change {decide_comps} to {new_classification} if {class_comp_exists} doesn't exist"
outputs["node_label"] = (
f"Change {decide_comps} to {new_classification} if {class_comp_exists} doesn't exist"
)
else:
outputs["node_label"] = (
f"Change {decide_comps} to {new_classification} if less than "
Expand Down
6 changes: 3 additions & 3 deletions tedana/selection/selection_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ def change_comptable_classifications(
dont_warn_reclassify=dont_warn_reclassify,
)

selector.component_status_table[
f"Node {selector.current_node_idx}"
] = selector.component_table["classification"]
selector.component_status_table[f"Node {selector.current_node_idx}"] = (
selector.component_table["classification"]
)

n_true = decision_boolean.sum()
n_false = np.logical_not(decision_boolean).sum()
Expand Down
1 change: 1 addition & 0 deletions tedana/selection/tedica.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to identify TE-dependent and TE-independent components."""

import logging

from tedana.metrics import collect
Expand Down
1 change: 1 addition & 0 deletions tedana/selection/tedpca.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to identify TE-dependent and TE-independent components."""

import logging

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tedana/stats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Statistical functions."""

import logging

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tedana/tests/test_component_selector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the decision tree modularization."""

import glob
import json
import os
Expand Down
1 change: 1 addition & 0 deletions tedana/tests/test_metrics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for tedana.metrics."""

import os.path as op

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tedana/tests/test_reporting.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for tedana.reporting."""

import numpy as np

from tedana import reporting
Expand Down
1 change: 1 addition & 0 deletions tedana/tests/test_selection_nodes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the tedana.selection.selection_nodes module."""

import os

import pytest
Expand Down
1 change: 1 addition & 0 deletions tedana/tests/test_selection_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the tedana.selection.selection_utils module."""

import os

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tedana/tests/test_stats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the tedana stats module."""

import random

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tedana/tests/test_workflows_parser_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test workflow parser utility functions."""

import argparse

import pytest
Expand Down
1 change: 1 addition & 0 deletions tedana/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for tedana package."""

import logging
import os.path as op
import platform
Expand Down
1 change: 1 addition & 0 deletions tedana/workflows/ica_reclassify.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Run the reclassification workflow for a previous tedana run."""

import argparse
import datetime
import logging
Expand Down
1 change: 1 addition & 0 deletions tedana/workflows/parser_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for parsers."""

import argparse
import os.path as op

Expand Down
1 change: 1 addition & 0 deletions tedana/workflows/t2smap.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Estimate T2 and S0, and optimally combine data across TEs."""

import argparse
import logging
import os
Expand Down
1 change: 1 addition & 0 deletions tedana/workflows/tedana.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Run the "canonical" TE-Dependent ANAlysis workflow."""

import argparse
import datetime
import json
Expand Down

0 comments on commit f9551a9

Please sign in to comment.