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

[REF, BRK] Decision tree modularization #476

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
13a54d4
Adds integration and five echo skipping
jbteves Nov 6, 2019
1bb1f18
Style fixes
jbteves Nov 6, 2019
08069d4
Updates config for CircleCI
jbteves Nov 6, 2019
3f50216
Merge remote-tracking branch 'upstream/master' into feature/pytest_sk…
jbteves Nov 6, 2019
067ac2b
Attempts to fix YML
jbteves Nov 6, 2019
888de0f
[TEST] Update Dockerfile to match new integr tests
rmarkello Nov 6, 2019
7209897
[TEST] Fixes integration tests in Docker image
rmarkello Nov 6, 2019
5d2b65a
[FIX] Remove intermediate IO files
rmarkello Nov 6, 2019
df6261f
Resolves merge conflict, adds output check
jbteves Nov 6, 2019
2210aa7
Some fixes
jbteves Nov 6, 2019
efd9e7a
[TEST] Updates dev_tool testing infra
rmarkello Nov 7, 2019
494bc63
[TEST] Fixes pytest integration path checking
rmarkello Nov 7, 2019
95dffda
[TEST] CircleCI uses Docker image to run tests
rmarkello Nov 7, 2019
3b966fa
[FIX] Minor dev_tool issues for CircleCI
rmarkello Nov 7, 2019
796a0d2
[TEST] Use variable for integration test filename
rmarkello Nov 7, 2019
769f4b7
Attempts to fix CircleCI style check
jbteves Nov 7, 2019
a4e17a8
Merge remote-tracking branch 'origin/feature/pytest_skip_integration'…
jbteves Nov 7, 2019
08a3ce3
Revert "Attempts to fix CircleCI style check"
jbteves Nov 7, 2019
8769d0b
Attempt to fix tput call
jbteves Nov 7, 2019
20086cb
Adds checkout to code in YML
jbteves Nov 7, 2019
3b1f4f6
[TEST] Integration tests run in parallel
rmarkello Nov 7, 2019
86b0a9b
[TEST] Separate data downloads from Docker build
rmarkello Nov 7, 2019
17ce437
[TEST] Update integration test data path
rmarkello Nov 7, 2019
0226e03
[TEST] CircleCI uses good Docker
rmarkello Nov 7, 2019
39fdae1
[TEST] No version check in circleci
rmarkello Nov 7, 2019
07e18e5
[TEST] Checkout for get_data / style check
rmarkello Nov 7, 2019
2ab23bd
Attempts to fix integration test inclusion
jbteves Nov 7, 2019
31b790a
Merge remote-tracking branch 'origin/feature/pytest_skip_integration'…
jbteves Nov 7, 2019
74551a0
[TEST] Checkout for get_data / style check
rmarkello Nov 7, 2019
a129019
[FIX] Fix circleci config hopefully
rmarkello Nov 7, 2019
9b59794
[FIX] No / workdir for circleci machine
rmarkello Nov 7, 2019
2301850
[FIX] Use ~ for coverage in circleci
rmarkello Nov 7, 2019
fa6d176
Switches integration tests to truncated length data
jbteves Nov 7, 2019
ef99664
Attempts to resolve merge conflict
jbteves Nov 7, 2019
24d4056
[FIX] Actually merge coverage files
rmarkello Nov 7, 2019
648e681
Set up decison tree modular framework
handwerkerd Nov 7, 2019
83f830b
Full decision modularization pre classes
handwerkerd Nov 7, 2019
5808407
make lint fixes
handwerkerd Nov 7, 2019
ec4450e
[FIX] style errors
handwerkerd Nov 7, 2019
57f95f1
Reorganize metrics.
tsalo Nov 8, 2019
2a27d7d
Merge remote-tracking branch 'ME-ICA/master' into modularize-metrics
tsalo Nov 8, 2019
7e136e8
Some more work on organizing metrics.
tsalo Nov 8, 2019
aae8a94
Add signal_minus_noise_z metric.
tsalo Nov 8, 2019
cca8d55
Variable name change.
tsalo Nov 8, 2019
8970805
Set up json and general structure for dtree class
handwerkerd Nov 8, 2019
2b5263f
fixed minor omission in selection_nodes
handwerkerd Nov 8, 2019
2a78cb9
Move comptable.
tsalo Nov 8, 2019
02c377d
Move T2* cap into decay function.
tsalo Nov 8, 2019
66b8726
Merge remote-tracking branch 'ME-ICA/master' into modularize-metrics
tsalo Nov 8, 2019
a175191
Split up metric files.
tsalo Nov 8, 2019
870207e
Adjust cluster-extent thresholding to match across maps.
tsalo Nov 9, 2019
6793694
Partially address review.
tsalo Nov 10, 2019
21db69a
Make DICE broadcastable.
tsalo Nov 10, 2019
9a968e1
Clean up signal-noise metrics and fix compute_countnoise.
tsalo Nov 10, 2019
c49ac58
Simplify calculate_z_maps.
tsalo Nov 10, 2019
710fe1b
Fix dice (thanks @rmarkello)
tsalo Nov 10, 2019
ad0eeb8
Adding more decision nodes
handwerkerd Nov 12, 2019
739593e
Improve documentation.
tsalo Nov 12, 2019
f6ffc0e
Fix import.
tsalo Nov 12, 2019
5f5ad40
Fix imports.
tsalo Nov 12, 2019
1e42112
[ENH,FIX] Fixing decision tree workflow
rmarkello Nov 13, 2019
409f647
Merge pull request #1 from rmarkello/DecisionTreeModularization
handwerkerd Nov 13, 2019
459f75c
DecisionTree running until bugs node functions
handwerkerd Nov 13, 2019
ec2dbcb
A complete but buggy full minimum decision tree
handwerkerd Nov 14, 2019
e061e77
decision tree through midk
handwerkerd Nov 15, 2019
aa99bbf
added classification_exists and tweaked inputs
handwerkerd Nov 15, 2019
44712f0
Get modularized metrics mostly working.
tsalo Nov 15, 2019
51909b8
Merge remote-tracking branch 'ME-ICA/master' into modularize-metrics
tsalo Nov 15, 2019
053c9e8
HORRIFYING MERGE COMMIT (see Josh for blame)
handwerkerd Nov 15, 2019
0911bd4
added low var, high meanmetricrank, high kappa node
handwerkerd Nov 17, 2019
3bb00c7
Fix bugs in metric calculations.
tsalo Nov 17, 2019
dfd0ba7
Revert changes to decision tree.
tsalo Nov 17, 2019
41c9a8b
Finish reverting.
tsalo Nov 17, 2019
5815a93
Fix viz.
tsalo Nov 17, 2019
6483cf7
Fix style issues
tsalo Nov 17, 2019
db5caac
More???
tsalo Nov 17, 2019
f02d9f3
Fix bug in generate_metrics.
tsalo Nov 18, 2019
4e9a020
Add initial tests.
tsalo Nov 18, 2019
f5ab022
Improve docstrings, add shape checks, and reorder functions.
tsalo Nov 18, 2019
96de3df
Fix assertions.
tsalo Nov 18, 2019
17c9949
Fix style issue.
tsalo Nov 18, 2019
b281367
Merge branch 'master' into modularize-metrics
tsalo Nov 18, 2019
23c682d
Add metric submodules to API docs.
tsalo Nov 18, 2019
7b4ea01
finished buggy full decision tree
handwerkerd Nov 20, 2019
9ea1ab2
Merge remote-tracking branch 'ME-ICA/master' into modularize-metrics
tsalo Nov 20, 2019
39b611c
Merge branch 'modularize-metrics' into DecisionTreeModularization
handwerkerd Nov 20, 2019
7afac29
Merge to 'upstream/ref/decision-tree'
handwerkerd Nov 22, 2019
aaad8be
Deleted intermediate unused files
handwerkerd Nov 22, 2019
2cce93a
Added user inputted paths for decision tree json
handwerkerd Nov 25, 2019
c629cee
improving RTD for decision tree modulation
handwerkerd Dec 2, 2019
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
12 changes: 8 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
- image: continuumio/miniconda3
working_directory: /tmp/src/tedana
steps:
- run:
name: Install parallel gzip and Python 3
command: |
apk add --no-cache pigz python3
- checkout
- restore_cache:
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}
Expand Down Expand Up @@ -111,7 +115,7 @@ jobs:
mkdir /tmp/src/coverage
mv /tmp/src/tedana/.coverage /tmp/src/coverage/.coverage.py37
- persist_to_workspace:
root: /tmp
root: ~/coverage
paths:
- src/coverage/.coverage.py37

Expand Down Expand Up @@ -150,7 +154,7 @@ jobs:
- store_artifacts:
path: /tmp/data
- persist_to_workspace:
root: /tmp
root: ~/coverage
paths:
- src/coverage/.coverage.three-echo
five-echo:
Expand Down Expand Up @@ -196,9 +200,9 @@ jobs:
coverage combine
coverage xml
- store_artifacts:
path: /tmp/src/coverage
path: ~/coverage
- codecov/upload:
file: /tmp/src/coverage/coverage.xml
file: ~/coverage/coverage.xml

workflows:
version: 2.1
Expand Down
48 changes: 48 additions & 0 deletions .pytest_cache/v/cache/nodeids
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[
"tedana/tests/test_combine.py::test__combine_t2s",
"tedana/tests/test_combine.py::test__combine_paid",
"tedana/tests/test_combine.py::test_make_optcom",
"tedana/tests/test_decay.py::test_fit_decay",
"tedana/tests/test_decay.py::test_fit_decay_ts",
"tedana/tests/test_decay.py::test_smoke_fit_decay",
"tedana/tests/test_decay.py::test_smoke_fit_decay_curvefit",
"tedana/tests/test_decay.py::test_smoke_fit_decay_ts",
"tedana/tests/test_decay.py::test_smoke_fit_decay_curvefit_ts",
"tedana/tests/test_gscontrol.py::test_break_gscontrol_raw",
"tedana/tests/test_io.py::test_new_nii_like",
"tedana/tests/test_io.py::test_filewrite",
"tedana/tests/test_io.py::test_load_data",
"tedana/tests/test_io.py::test_smoke_split_ts",
"tedana/tests/test_io.py::test_smoke_write_split_ts",
"tedana/tests/test_io.py::test_smoke_writefeats",
"tedana/tests/test_io.py::test_smoke_filewrite",
"tedana/tests/test_io.py::test_smoke_load_data",
"tedana/tests/test_model_fit_dependence_metrics.py::test_break_dependence_metrics",
"tedana/tests/test_model_kundu_metrics.py::test_smoke_kundu_metrics",
"tedana/tests/test_selection.py::test_manual_selection",
"tedana/tests/test_stats_computefeats2.py::test_break_computefeats2",
"tedana/tests/test_stats_computefeats2.py::test_smoke_computefeats2",
"tedana/tests/test_stats_get_coeffs.py::test_get_coeffs",
"tedana/tests/test_stats_get_coeffs.py::test_break_get_coeffs",
"tedana/tests/test_stats_get_coeffs.py::test_smoke_get_coeffs",
"tedana/tests/test_stats_getfbounds.py::test_getfbounds",
"tedana/tests/test_stats_getfbounds.py::test_smoke_getfbounds",
"tedana/tests/test_t2smap.py::TestT2smap::test_basic_t2smap1",
"tedana/tests/test_t2smap.py::TestT2smap::test_basic_t2smap2",
"tedana/tests/test_t2smap.py::TestT2smap::test_basic_t2smap3",
"tedana/tests/test_t2smap.py::TestT2smap::test_basic_t2smap4",
"tedana/tests/test_utils.py::test_unmask",
"tedana/tests/test_utils.py::test_dice",
"tedana/tests/test_utils.py::test_andb",
"tedana/tests/test_utils.py::test_load_image",
"tedana/tests/test_utils.py::test_make_adaptive_mask",
"tedana/tests/test_utils.py::test_smoke_load_image",
"tedana/tests/test_utils.py::test_smoke_make_adaptive_mask",
"tedana/tests/test_utils.py::test_smoke_unmask",
"tedana/tests/test_utils.py::test_smoke_dice",
"tedana/tests/test_utils.py::test_smoke_andb",
"tedana/tests/test_utils.py::test_smoke_get_spectrum",
"tedana/tests/test_utils.py::test_smoke_threshold_map",
"tedana/tests/test_viz.py::test_smoke_trim_edge_zeros",
"tedana/tests/test_integration_three_echo.py::test_integration_three_echo"
]
1 change: 1 addition & 0 deletions .pytest_cache/v/cache/stepwise
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
58 changes: 58 additions & 0 deletions dev_tools/build_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env bash

update_dev_dockerfile() {
#
# Generates Dockerfile to build Docker image for local tedana testing
#

generate_ipython_config="
/opt/conda/envs/tedana_py36/bin/ipython profile create
&& sed -i 's/#c.InteractiveShellApp.extensions = \[\]/c.InteractiveShellApp.extensions = \['\''autoreload'\''\]/g' /root/.ipython/profile_default/ipython_config.py"

call_dir=${PWD}
git_root=$( git rev-parse --show-toplevel ); cd "${git_root}"
docker run --rm kaczmarj/neurodocker:0.6.0 generate docker \
--base debian:latest \
--pkg-manager apt \
--env LANG=C.UTF-8 LC_ALL=C.UTF-8 \
--install curl git wget bzip2 ca-certificates sed openssh-client \
--run "mkdir -p /tedana/dev_tools/envs" \
--copy ./dev_tools/envs/py35_env.yml /tedana/dev_tools/envs/py35_env.yml \
--copy ./dev_tools/envs/py36_env.yml /tedana/dev_tools/envs/py36_env.yml \
--copy ./dev_tools/envs/py37_env.yml /tedana/dev_tools/envs/py37_env.yml \
--miniconda create_env=tedana_py35 \
install_path=/opt/conda \
yaml_file=/tedana/dev_tools/envs/py35_env.yml \
activate_env=false \
--miniconda create_env=tedana_py36 \
install_path=/opt/conda \
yaml_file=/tedana/dev_tools/envs/py36_env.yml \
activate_env=true \
--miniconda create_env=tedana_py37 \
install_path=/opt/conda \
yaml_file=/tedana/dev_tools/envs/py37_env.yml \
activate_env=false \
--run "${generate_ipython_config}" \
--copy "./dev_tools" /tedana/dev_tools \
--add-to-entrypoint "source activate tedana_py36" \
--add-to-entrypoint "source /tedana/dev_tools/run_tests.sh" \
--workdir /tedana \
> ./Dockerfile_dev
cd "${call_dir}"
}


build_dev_image() {
#
# Recreates local Dockerfile and builds tedana/tedana-dev:local Docker image
#

if [ ! -z "${1}" ]; then
tag="${1}"
else
tag=local
fi

update_dev_dockerfile
docker build --tag tedana/tedana-dev:"${tag}" -f Dockerfile_dev .
}
31 changes: 31 additions & 0 deletions dev_tools/get_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

get_three_echo_test_data() {
mkdir -p /tmp/data/three-echo
curl -s -L -o /tmp/data/three-echo/three_echo_Cornell_zcat.nii.gz https://osf.io/gfkw7/download
}
# && curl -L -o TED.Cornell_processed_three_echo_dataset.tar.xz https://osf.io/u65sq/download
# && tar xf TED.Cornell_processed_three_echo_dataset.tar.xz --no-same-owner -C /data/test/three-echo/
# && rm -f TED.Cornell_processed_three_echo_dataset.tar.xz'


get_five_echo_test_data() {
mkdir /tmp/data/five-echo
curl -s -L https://osf.io/h6bmw/download | tar xJf - -C /tmp/data/five-echo
}
# && curl -L -o TED.p06.tar.xz https://osf.io/fr6mx/download
# && tar xf TED.p06.tar.xz --no-same-owner -C /data/test/five-echo/
# && rm -f TED.p06.tar.xz'


download_data() {
for ds in three-echo five-echo; do
datadir=/tmp/data/${ds}
# if the data directory doesn't exist OR the data directory is empty
# then download the data for the specified dataset
if [ ! -d ${datadir} ] || [ ! "$( ls -A ${datadir} )" ]; then
printf "Downloading ${ds} data into ${datadir}\n"
get_${ds/-/_}_test_data
fi
done
}
52 changes: 52 additions & 0 deletions dev_tools/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

<<<<<<< HEAD
DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIRECTORY}/get_data.sh

=======
>>>>>>> tsala/modularize-metrics
cprint() {
#
# Prints all supplied arguments as a bold, green string
Expand All @@ -17,6 +23,32 @@ cprint() {
}


<<<<<<< HEAD
run_integration_tests() {
#
# Runs tedana integration tests; passes any parameters to py.test
#

download_data
cprint "RUNNING INTEGRATION TESTS"
source activate tedana_py36
py.test "$@" --cov-append --cov-report term-missing --cov=tedana tedana/tests/test_integration.py
}


run_unit_test() {
#
# Runs tedana unit tests for provided Python environment
#
# Required argments:
# pyenv name of python environment to use for testing. should
# be one of [tedana_py35, tedana_py36, tedana_py37]
#

cprint "RUNNING UNIT TESTS FOR PYTHON ENVIRONMENT: ${1}"
source activate "${1}"
py.test --skipintegration --cov-append --cov-report term-missing --cov=tedana tedana
=======
run_three_echo_test() {
#
# Runs tedana three-echo test
Expand Down Expand Up @@ -44,6 +76,7 @@ run_unit_tests() {
cprint "RUNNING UNIT TESTS"
make unittest
cprint "UNIT TESTS PASSED !"
>>>>>>> tsala/modularize-metrics
}


Expand All @@ -52,14 +85,32 @@ run_lint_tests() {
# Lints the tedana codebase
#

<<<<<<< HEAD
cprint "RUNNING FLAKE8 ON TEDANA DIRECTORY"
source activate tedana_py36
flake8 tedana
=======
cprint "RUNNING FLAKE8 TO LINT CODEBASE"
make lint
cprint "CODEBASE LINTED SUCCESSFULLY !"
>>>>>>> tsala/modularize-metrics
}


run_all_tests() {
#
<<<<<<< HEAD
# Runs tedana test suite excluding five-echo test by default
#

run_lint_tests
for pyenv in tedana_py3{5,6,7}; do
run_unit_test "${pyenv}"
done
run_integration_tests

cprint "FINISHED RUNNING ALL TESTS! GREAT SUCCESS"
=======
# Runs tedana test suite
#

Expand All @@ -69,4 +120,5 @@ run_all_tests() {
run_five_echo_test

cprint "FINISHED RUNNING ALL TESTS -- GREAT SUCCESS !"
>>>>>>> tsala/modularize-metrics
}
1 change: 1 addition & 0 deletions docs/_templates/function.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
.. raw:: html

<div class="clearer"></div>

3 changes: 3 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ API
tedana.selection.manual_selection
tedana.selection.kundu_selection_v2

:template: module.rst
tedana.selection.selection_nodes
tedana.selection.decision_tree_class

.. _api_gscontrol_ref:

Expand Down
Loading