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, TST] Fix the failing tests #518

Merged
merged 16 commits into from
Jan 16, 2020
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}-{{ checksum "requirements.txt" }}
- run:
name: Generate environment
command: |
Expand All @@ -24,7 +24,7 @@ jobs:
pip install -r dev_requirements.txt
fi
- save_cache:
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}-{{ checksum "requirements.txt" }}
paths:
- /opt/conda/envs/tedana_py37

Expand All @@ -35,7 +35,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: conda-py35-v1-{{ checksum "dev_requirements.txt" }}
key: conda-py35-v1-{{ checksum "dev_requirements.txt" }}-{{ checksum "requirements.txt" }}
- run:
name: Generate environment
command: |
Expand All @@ -53,7 +53,7 @@ jobs:
mkdir /tmp/src/coverage
mv /tmp/src/tedana/.coverage /tmp/src/coverage/.coverage.py35
- save_cache:
key: conda-py35-v1-{{ checksum "dev_requirements.txt" }}
key: conda-py35-v1-{{ checksum "dev_requirements.txt" }}-{{ checksum "requirements.txt" }}
paths:
- /opt/conda/envs/tedana_py35
- persist_to_workspace:
Expand All @@ -68,7 +68,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: conda-py36-v1-{{ checksum "dev_requirements.txt" }}
key: conda-py36-v1-{{ checksum "dev_requirements.txt" }}-{{ checksum "requirements.txt" }}
- run:
name: Generate environment
command: |
Expand All @@ -86,7 +86,7 @@ jobs:
mkdir /tmp/src/coverage
mv /tmp/src/tedana/.coverage /tmp/src/coverage/.coverage.py36
- save_cache:
key: conda-py36-v1-{{ checksum "dev_requirements.txt" }}
key: conda-py36-v1-{{ checksum "dev_requirements.txt" }}-{{ checksum "requirements.txt" }}
paths:
- /opt/conda/envs/tedana_py36
- persist_to_workspace:
Expand All @@ -101,7 +101,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}-{{ checksum "requirements.txt" }}
- run:
name: Running unit tests
command: |
Expand All @@ -122,7 +122,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}-{{ checksum "requirements.txt" }}
- run:
name: Style check
command: |
Expand All @@ -137,7 +137,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}-{{ checksum "requirements.txt" }}
- run:
name: Run integration tests
no_output_timeout: 40m
Expand All @@ -161,7 +161,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}-{{ checksum "requirements.txt" }}
- run:
name: Run integration tests
no_output_timeout: 40m
Expand All @@ -185,7 +185,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}-{{ checksum "requirements.txt" }}
- run:
name: Run integration tests
no_output_timeout: 40m
Expand All @@ -211,7 +211,7 @@ jobs:
at: /tmp
- checkout
- restore_cache:
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}
key: conda-py37-v1-{{ checksum "dev_requirements.txt" }}-{{ checksum "requirements.txt" }}
- run:
name: Merge coverage files
command: |
Expand Down
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sphinx
sphinx-argparse
sphinx_rtd_theme
coverage
coverage<5.0
flake8>=3.7
numpydoc
pytest
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
duecredit
matplotlib
nibabel>=2.1.0
nilearn
numpy>=1.14
nibabel>=2.5.1
nilearn>=0.5.2
numpy>=1.15
pandas
scikit-learn
scipy
scikit-learn>=0.22
scipy>=1.3.3
2 changes: 1 addition & 1 deletion tedana/metrics/kundu_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def dependence_metrics(catd, tsoc, mmix, t2s, tes, ref_img,
't2s ({1})'.format(catd.shape[2], t2s.shape[1]))

RepLGR.info("A series of TE-dependence metrics were calculated for "
"each ICA component, including Kappa, Rho, and variance "
"each component, including Kappa, Rho, and variance "
"explained.")

# mask everything we can
Expand Down
36 changes: 36 additions & 0 deletions tedana/tests/data/cornell_three_echo_outputs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,42 @@ figures/comp_032.png
figures/comp_033.png
figures/comp_034.png
figures/comp_035.png
figures/comp_036.png
figures/comp_037.png
figures/comp_038.png
figures/comp_039.png
figures/comp_040.png
figures/comp_041.png
figures/comp_042.png
figures/comp_043.png
figures/comp_044.png
figures/comp_045.png
figures/comp_046.png
figures/comp_047.png
figures/comp_048.png
figures/comp_049.png
figures/comp_050.png
figures/comp_051.png
figures/comp_052.png
figures/comp_053.png
figures/comp_054.png
figures/comp_055.png
figures/comp_056.png
figures/comp_057.png
figures/comp_058.png
figures/comp_059.png
figures/comp_060.png
figures/comp_061.png
figures/comp_062.png
figures/comp_063.png
figures/comp_064.png
figures/comp_065.png
figures/comp_066.png
figures/comp_067.png
figures/comp_068.png
figures/comp_069.png
figures/comp_070.png
figures/comp_071.png
dn_ts_OC.nii.gz
feats_OC2.nii.gz
figures
Expand Down
58 changes: 29 additions & 29 deletions tedana/tests/data/fiu_four_echo_outputs.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
T1gs.nii.gz
adaptive_mask.nii.gz
betas_OC.nii.gz
betas_hik_OC.nii.gz
betas_hik_OC_T1c.nii.gz
dn_ts_OC.nii.gz
feats_OC2.nii.gz
figures
hik_ts_OC.nii.gz
dn_ts_OC_T1c.nii.gz
dn_ts_e1.nii.gz
dn_ts_e2.nii.gz
dn_ts_e3.nii.gz
dn_ts_e4.nii.gz
glsig.1D
hik_ts_OC_T1c.nii.gz
ica_components.nii.gz
ica_decomposition.json
ica_mixing.tsv
ica_orth_mixing.tsv
lowk_ts_OC.nii.gz
lowk_ts_e1.nii.gz
lowk_ts_e2.nii.gz
lowk_ts_e3.nii.gz
lowk_ts_e4.nii.gz
meica_R2_pred.nii.gz
meica_S0_pred.nii.gz
meica_betas_catd.nii.gz
meica_metric_weights.nii.gz
meica_mix_T1c.1D
mepca_R2_pred.nii.gz
mepca_S0_pred.nii.gz
mepca_betas_catd.nii.gz
mepca_metric_weights.nii.gz
pca_components.nii.gz
pca_decomposition.json
pca_mixing.tsv
report.txt
s0v.nii.gz
s0vG.nii.gz
sphis_hik.nii.gz
t2sv.nii.gz
t2svG.nii.gz
ts_OC.nii.gz
ts_OC_whitened.nii.gz
tsoc_nogs.nii.gz
tsoc_orig.nii.gz
figures
figures/Component_Overview.png
figures/Kappa_vs_Rho_Scatter.png
figures/Kappa_Rho_Scree_plot.png
Expand All @@ -41,27 +65,3 @@ figures/comp_017.png
figures/comp_018.png
figures/comp_019.png
figures/comp_020.png
figures/comp_021.png
figures/comp_022.png
figures/comp_023.png
figures/comp_024.png
figures/comp_025.png
figures/comp_026.png
figures/comp_027.png
figures/comp_028.png
figures/comp_029.png
figures/comp_030.png
figures/comp_031.png
figures/comp_032.png
figures/comp_033.png
figures/comp_034.png
figures/comp_035.png
figures/comp_036.png
figures/comp_037.png
figures/comp_038.png
figures/comp_039.png
figures/comp_040.png
figures/comp_041.png
figures/comp_042.png
figures/comp_043.png
figures/comp_044.png
18 changes: 9 additions & 9 deletions tedana/tests/data/nih_five_echo_outputs_verbose.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
T1gs.nii.gz
adaptive_mask.nii.gz
betas_OC.nii.gz
betas_hik_OC.nii.gz
betas_hik_OC_T1c.nii.gz
dn_ts_OC.nii.gz
dn_ts_OC_T1c.nii.gz
dn_ts_e1.nii.gz
dn_ts_e2.nii.gz
dn_ts_e3.nii.gz
dn_ts_e4.nii.gz
dn_ts_e5.nii.gz
feats_OC2.nii.gz
glsig.1D
hik_ts_OC.nii.gz
hik_ts_OC_T1c.nii.gz
hik_ts_e1.nii.gz
hik_ts_e2.nii.gz
hik_ts_e3.nii.gz
Expand All @@ -22,6 +17,7 @@ hik_ts_e5.nii.gz
ica_components.nii.gz
ica_decomposition.json
ica_mixing.tsv
ica_orth_mixing.tsv
lowk_ts_OC.nii.gz
lowk_ts_e1.nii.gz
lowk_ts_e2.nii.gz
Expand All @@ -32,7 +28,6 @@ meica_R2_pred.nii.gz
meica_S0_pred.nii.gz
meica_betas_catd.nii.gz
meica_metric_weights.nii.gz
meica_mix_T1c.1D
mepca_R2_pred.nii.gz
mepca_S0_pred.nii.gz
mepca_betas_catd.nii.gz
Expand All @@ -43,13 +38,10 @@ pca_mixing.tsv
report.txt
s0v.nii.gz
s0vG.nii.gz
sphis_hik.nii.gz
t2sv.nii.gz
t2svG.nii.gz
ts_OC.nii.gz
ts_OC_whitened.nii.gz
tsoc_nogs.nii.gz
tsoc_orig.nii.gz
figures
figures/Component_Overview.png
figures/Kappa_vs_Rho_Scatter.png
Expand Down Expand Up @@ -117,3 +109,11 @@ figures/comp_059.png
figures/comp_060.png
figures/comp_061.png
figures/comp_062.png
figures/comp_063.png
figures/comp_064.png
figures/comp_065.png
figures/comp_066.png
figures/comp_067.png
figures/comp_068.png
figures/comp_069.png
figures/comp_070.png
24 changes: 13 additions & 11 deletions tedana/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ def test_integration_five_echo(skip_integration):
data=datalist,
tes=[15.4, 29.7, 44.0, 58.3, 72.6],
out_dir=out_dir,
tedpca='mdl',
gscontrol=['gsr', 't1c'],
png_cmap='bone',
debug=True,
tedpca='aic',
fittype='curvefit',
tedort=True,
verbose=True)

# Just a check on the component table pending a unit test of load_comptable
Expand Down Expand Up @@ -124,12 +123,15 @@ def test_integration_four_echo(skip_integration):
prepend += 'sub-PILOT_ses-01_task-localizerDetection_run-01_echo-'
suffix = '_space-sbref_desc-preproc_bold+orig.HEAD'
datalist = [prepend + str(i + 1) + suffix for i in range(4)]
tedana_workflow(data=datalist,
tes=[11.8, 28.04, 44.28, 60.52],
out_dir=out_dir,
tedpca='aic',
fittype='curvefit',
tedort=True)
tedana_workflow(
data=datalist,
tes=[11.8, 28.04, 44.28, 60.52],
out_dir=out_dir,
tedpca='kundu-stabilize',
gscontrol=['gsr', 't1c'],
png_cmap='bone',
debug=True,
verbose=True)

# compare the generated output files
fn = resource_filename('tedana', 'tests/data/fiu_four_echo_outputs.txt')
Expand All @@ -155,7 +157,7 @@ def test_integration_three_echo(skip_integration):
tes=[14.5, 38.5, 62.5],
out_dir=out_dir,
low_mem=True,
tedpca='kundu-stabilize')
tedpca='mdl')

# test rerunning the workflow
tedana_workflow(
Expand Down