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] Add out_dir argument to filewriting functions #500

Merged
merged 12 commits into from
Jan 23, 2020

Conversation

tsalo
Copy link
Member

@tsalo tsalo commented Dec 12, 2019

Closes #494.

Changes proposed in this pull request:

  • Add out_dir argument to gscontrol functions.
  • Add out_dir argument to io functions.
  • Remove unnecessary chdir call.

@tsalo tsalo added the refactoring issues proposing/requesting changes to the code which do not impact behavior label Dec 12, 2019
tedana/io.py Show resolved Hide resolved
@jbteves
Copy link
Collaborator

jbteves commented Dec 12, 2019

@tsalo tests are going to fail because you're missing ts_OC; why are we getting rid of it?

jbteves
jbteves previously approved these changes Dec 12, 2019
Copy link
Collaborator

@jbteves jbteves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tsalo
Copy link
Member Author

tsalo commented Dec 12, 2019

Okay, the current bug is a weird combination of nibabel.filename_parser.splitext_addext, our choices regarding the test data output directory, and how we call filewrite.

We tend to provide io.filewrite with filenames without extensions, because those extensions are overwritten with nii.gz or nii by the function. io.filewrite uses nibabel.filename_parser.splitext_addext to get the extension for the input filename, even when there's an extra extension like .gz.

When we feed in a filename without periods, that's fine. splitext_addext identifies everything as root (i.e., no extension).

When we feed in a filename with periods in the paths but also an extension, that's also fine. splitext_addext correctly identifies the extension.

However, when we feed in a filename with no extension, but with periods in the paths (as we have in our tests), splitext_addext interprets the period in the path as the separator between the filename and its extension, and that breaks our tests here.

Solutions:

  1. Require that inputs to filewrite have extensions.
    • Hard to check programmatically since we'd probably rely on splitext_addext, but at least the documentation and internal calls could be consistent.
  2. Add an additional step in io.filewrite with os.path.basename.
    • This pretty much means that splitext_addext is wrong, but we want to handle it internally.
  3. Open an issue to nibabel.
    • Might take a while for them to deal with it, assuming they consider it an actual bug.

I'm leaning toward 2. @jbteves @emdupre WDYT?

@codecov
Copy link

codecov bot commented Dec 12, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@6da1283). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##             master    #500   +/-   ##
========================================
  Coverage          ?   84.6%           
========================================
  Files             ?      41           
  Lines             ?    2916           
  Branches          ?       0           
========================================
  Hits              ?    2467           
  Misses            ?     449           
  Partials          ?       0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6da1283...ef6dc22. Read the comment docs.

@jbteves
Copy link
Collaborator

jbteves commented Dec 12, 2019

My interpretation of this is that this is an undefined case. We should probably remove the periods in test case names, and reserve periods for file extensions only. I think that there's not a way for splitext to know whether it's a path with an extension or a filename missing an extension that happens to have periods without using magic numbers (as in file). I think we should roll with (2) even though I'm not sure that splitext is "wrong" for now, and move towards abolishing periods that don't mean "file extension after here."

@tsalo
Copy link
Member Author

tsalo commented Dec 13, 2019

I think that there's not a way for splitext to know whether it's a path with an extension or a filename missing an extension that happens to have periods without using magic numbers (as in file)

It's true that the function can't know that a period in a filename is not an extension delimiter, but it should be able to tell that a period in the file's path isn't. Here's an example:

  • /path/to/file.name --> cannot know that .name is part of the filename and not a function
  • /path/to.file/name --> should know that .file/name is not an extension, since / is a path delimiter.

I've pushed the basename fix (number 2), and it seems to work.

@jbteves
Copy link
Collaborator

jbteves commented Dec 13, 2019

@tsalo true, the second case is unambiguous. And that is the case we're running into. Hm. It's probably a lot of dev workarounds but it's worth filing with nibabel.

jbteves
jbteves previously approved these changes Dec 13, 2019
Copy link
Collaborator

@jbteves jbteves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be the best solution for now. Please tag this issue if you open in nibabel, or if you want me to I can raise it there and link this.

@jbteves
Copy link
Collaborator

jbteves commented Jan 21, 2020

@handwerkerd it turns out I'm the one who approved this, so an additional review by me isn't adequate to merge this.

@jbteves
Copy link
Collaborator

jbteves commented Jan 21, 2020

@tsalo was there a merge conflict before?

jbteves
jbteves previously approved these changes Jan 21, 2020
Copy link
Collaborator

@jbteves jbteves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tsalo
Copy link
Member Author

tsalo commented Jan 21, 2020

@jbteves yes to the merge conflict an hour ago and then there was another after merging #408.

Copy link
Collaborator

@jbteves jbteves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Pretty excited for this change, thanks @tsalo !

@jbteves jbteves requested a review from dowdlelt January 22, 2020 23:35
@jbteves
Copy link
Collaborator

jbteves commented Jan 22, 2020

@dowdlelt requested your review since you helpfully reviewed #408/#508, and this touches on some of the same bits of code. If you don't have time don't sweat it, I'll find someone else.

Copy link
Collaborator

@dowdlelt dowdlelt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything here looks straightforward to me - cannot hurt to make out directories more flexible, so I'm for it. I see no problems in these changes.

I am a bit confused by the 'remove stabilize' bit though - is that still relevant here? I don't see it in the code...

@tsalo
Copy link
Member Author

tsalo commented Jan 23, 2020

Yeah, I must have dealt with it in another PR. I'll remove it from the summary. Thanks for the reviews!

@tsalo tsalo merged commit 5ce8296 into ME-ICA:master Jan 23, 2020
@tsalo tsalo deleted the ref/add-out-dir branch January 23, 2020 02:04
tsalo added a commit that referenced this pull request Aug 7, 2020
* Reorganize metrics.

* Some more work on organizing metrics.

* Add signal_minus_noise_z metric.

* Variable name change.

* edited gitignore after testing

* Revert "edited gitignore after testing"

This reverts commit 28098e1.

* fix the +0 -0 absurdity and actually commit

* silly underscore go away

* style fix

* I swear I can spell things.

* Move comptable.

* more style

* Move T2* cap into decay function.

* Split up metric files.

* Adjust cluster-extent thresholding to match across maps.

* Partially address review.

Lots of great refactoring by @rmarkello.

* Make DICE broadcastable.

* Clean up signal-noise metrics and fix compute_countnoise.

* Simplify calculate_z_maps.

* Fix dice (thanks @rmarkello)

* use index, doesn't have component

* add the scree to the outputs

* Improve documentation.

* Fix import.

* Fix imports.

* Get modularized metrics mostly working.

* Fix bugs in metric calculations.

All metrics should be calculated on *masked* data. Any metric maps
should also be masked.

* Revert changes to decision tree.

* Finish reverting.

* Fix viz.

* Fix style issues

* More???

* Fix bug in generate_metrics.

* Add initial tests.

* Improve docstrings, add shape checks, and reorder functions.

* Fix assertions.

* Fix style issue.

* Add metric submodules to API docs.

* Improve reporting for T_to_Z transform.

* Fix bugs in new modularized dependence metrics.

* [MNT] Drop versioneer from requirements (#481)

* MNT: Drop versioneer from requirements

The versioneer package is not a requirement to use versioneer.

* MNT: Add versioneer to a new "dev" extra

* [ENH] Adds maPCA decomposition algorithm (#435)

* Create fix/decomp branch

* Started writing GIFT version in Pythonn as we found it selects a reasonable number of components

* Advanced on new PCA computation

* Solved NAN issues and added testing data

* Solved est_indp_sp bug

* PCA is SOLVED! Hooray!

* PR request ready version of the PCA fix

* fix: avoid circular imports

* Bug fixes and started working on docstrings

* [FIX] Clean up some variables in GIFT PCA (#453)

* Added version argument (#415)

* Added version argument

* changed import of __version__

* [REF] No pytest_cache dir

* [ENH] Dockerfile for dev testing

* [DOC] Add docs for code testing to CONTRIBUTING

* [REF] Docker org can't have hyphens

Just use tedana/tedana-dev namespace

* Changed default export in gzipped nifti (#416)

* Changed default export in gzipped nifti

* Updated extension of files in tests

* [FIX] Update typo in .gitignore

Co-Authored-By: Joshua Teves <jbtevespro@gmail.com>

* [REF, DOC] Use logging to generate reports (#424)

* Use logging for report/references generation.

* Improve ContextFilter docstring.

* Remove broken newlines.

* Make the style good.

* [ENH][TST] Overhauls CI completely (#418)

* Adds integration and five echo skipping

* Style fixes

* Updates config for CircleCI

* Attempts to fix YML

* [TEST] Update Dockerfile to match new integr tests

* [TEST] Fixes integration tests in Docker image

* [FIX] Remove intermediate IO files

* Resolves merge conflict, adds output check

* Some fixes

* [TEST] Updates dev_tool testing infra

* [TEST] Fixes pytest integration path checking

* [TEST] CircleCI uses Docker image to run tests

* [FIX] Minor dev_tool issues for CircleCI

* [TEST] Use variable for integration test filename

* Attempts to fix CircleCI style check

* Revert "Attempts to fix CircleCI style check"

This reverts commit 769f4b7.

* Attempt to fix tput call

* Adds checkout to code in YML

* [TEST] Integration tests run in parallel

* [TEST] Separate data downloads from Docker build

* [TEST] Update integration test data path

* [TEST] CircleCI uses good Docker

* [TEST] No version check in circleci

* [TEST] Checkout for get_data / style check

* Attempts to fix integration test inclusion

* [TEST] Checkout for get_data / style check

* [FIX] Fix circleci config hopefully

* [FIX] No / workdir for circleci machine

* [FIX] Use ~ for coverage in circleci

* Switches integration tests to truncated length data

* [FIX] Actually merge coverage files

* [FIX] Coverage cache path circleci

* [TEST] Integration test outputs in tests/data

* [FIX] circleci config bug

* [TEST] Major testing infra overhaul

Docker image considerably slimmed down (only test python 3.6 locally),
added new dev_requirements.txt to make conda yaml files obsolete, added
Makefile to make testing easier locally (if you aren't using the Docker
image), and removed integration test data downloads from separate script
and into the integration tests themselves

* [TEST] Massive CircleCI config regression

@tsalo had it right --- moving towards a fully Dockerized implementation
was not the way forward for a simple Python package.

* [TEST] Better integration testing?

At least, more equivalent to what was happening before, where we check
that ONLY the expected output files are generated (no more, no less)

* [FIX] CircleCI workflow issue

* [MNT] No flake8-putty

* [FLK] New flake8 error detected

* [TEST] Run style check separately

@leej3 said it's not fair to stop running tests for a few minor style
errors, and he's usually right so....

* [TEST] Py37 for all non-unit test stuff

* [WIP,TEST,DOC] Builds docs in CircleCI (#428)

* [REF] Fix up dev vs non-dev requirements.txt

* [TEST] Build docs in CircleCI

Also modifies the building of the py37 environment a bit since it's
shared between so many things

* [REF] Change tab-delimited files from txt extension to tsv (#429)

* Change comptables and log from txt to tsv.

* Prevents shell expansion in API (#431)

* enh: add stale-bot (#430)

* edited gitignore after testing

* Revert "edited gitignore after testing"

This reverts commit 28098e1.

* fixing typo and clarity

* cleaning up approach introduction

* more cleanup in approach

* adding initial plot to pubs page

* correcting plots

* removing comment parts

* getting live plots working on publication page

* clean up and adding more WIP details

* completing live TE plot from spreasheet

* changing outputs to nii.gz

* adding TR and Vox dim subplots

* initial adding of output details

* fixing tables

* rearranging to considerations and recomendations

* seperating out considerations section

* technically spelling things correct

* started fixing titles

* addinf figures for what is ME page

* title clarification

* Add information about GE

* adding mutliecho questions to the FAQ

* initial adding to multiecho

* multiecho page figures and explanations

* pipeline and phsyics updated

* typo

* fix headings

* possibly clean latex?

* we have eight echoes

* more details in approach

* title change

* adding software details

* clean up of multiecho

* additional considerations!

* typo

* update plots

* due credit in faq

* more details on multi echo, usage

* tedana does accept BRIK/HEAD

* someone wanted sentences seperated

* life by a thousand little edits

* GrAmMaRs

* other software!

* links to api in approach

* white space?

* [ENH] Make png default (#427)

* Makes --png default, adds --nopng

* Fixes integration test for --nopng

* Adds correction to integration test outputs

* Update docs/faq.rst

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* MRI scanners != BBQ

* Update docs/approach.rst

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Update docs/approach.rst

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Apply suggestions from code review, thanks a million

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* echo cleanup, and kundu 3 banish

* noted png default

* completely changed the QC section

* pls wrk

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* docs: add jbteves as a contributor (#442)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add eurunuela as a contributor (#441)

* docs: update README.md

* docs: update .all-contributorsrc

* [ENH][TST] Feature/parallel integration (#437)

* Adjusts makefile to include three-echo and five-echo, remove integration
* Adjusts CircleCI config to do the same as makefile 
* Removes doc auto-building via CircleCI

* [FIX] Adds check for just one component (#405)

* Adds check for just one component

* [ENH] Consolidate stats unit tests and fix linting errors in tests (#421)

* Consolidates stats unit tests
* Changes to simpler assert for stats errors
* Oof linting

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Clean up some variables.

* Fix output name.

* Fix bugs and use TruncatedSVD in GIFT.

* Normalization of data added

* doc: fix linting errors

* Second if statement in _checkOrder does not check for None values now, as these should never be given to the function.

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Style editing to gift_pca.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Style editing to gift_pca.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Removed silly comment inherited from MATLAB

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Removed print statement int gift_pca.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Commented TruncatedSVD as it does not provide the functionality we are looking for. Also, made some edits after the comments from Elizabeth

* Removed unused import

* Changed some of the print statements to make them more user friendly

* Adds documentation

* Fixes PCA memory madness

* Fixes linter errors

* Now accounting for imprecission in kurtosis calculation

* Edited autocorr docstring

* GIFT PCA doesn't use the var normalized now in order to get the same number of components as the original GIFT algorithm. This is something we should definitely discuss

* Corrections to style

* Changed test output expected

* Removed GIFT notebook

* Made MDL the default and added GIFT reference

* Removed GIFT testing data

* Changes as commented in PR review

* Style fix

* Changed variable names to make them more readble

* Style fix

* Style fix

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Changes suggested in PR review

* More changes based on PR review suggestions

* Changes to workflows/tedana.py based on PR review suggestions

* Changes to decomposition/pca.py based on PR review suggestions

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* More review changes

* Style fixes

* Finished with PR review suggestinos

* Update tedana/decomposition/gift.py

Co-Authored-By: Taylor Salo <tsalo006@fiu.edu>

* Update tedana/decomposition/gift.py

Co-Authored-By: Taylor Salo <tsalo006@fiu.edu>

* Renamed gift to ma_pca and added some math notes

* Added more maths-related comments

* Renamed ma_pca function

* Added unit test for maPCA and fixed a typo in ma_pca.py

* Added unit test for maPCA and fixed a typo in ma_pca.py

* Added unit test for ent_rate_sp inside maPCA

* Added test for constant input to ent_rate_sp

* Documentation fix

Co-Authored-By: Joshua Teves <jbtevespro@gmail.com>

* Documentation fix

Co-Authored-By: Joshua Teves <jbtevespro@gmail.com>

* Removed if statements in ent_rate_sp as they were never going to be accessed in our case. Also addressed some PR review comments.

* Style fix

* Update tedana/decomposition/ma_pca.py

Co-Authored-By: Joshua Teves <jbtevespro@gmail.com>

* Update tedana/decomposition/ma_pca.py

Co-Authored-By: Joshua Teves <jbtevespro@gmail.com>

* Addresses documentation suggestions

* [TST] Expands integration (#482)

* Expands integration testing to include mapca and several of its options

* [REF] Remove the sourceTEs option (#493)

* [REF] Removes mle option (#495)

* Removes mle option

* [REF] Remove confusing variable copy (#498)

* mmix -> mmix_new

* Change variable name.

* add new plot to all tests

* removing to_numpy(), plt. to fig.

* docs: add Islast as a contributor (#503)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* [DOC] Adds developer guideline start (#446)

* Adds developer guideline start
* Modifies CONTRIBUTING
* Fixes dead link, removes project board
* Adds more thorough developing guidelines
* Fix lack of linting
* Updates dev requirements
* Adds flake8 instructions
* Updates config with correct CI version
* Adds manual selection of artifiacts through CircleCI UI
* Adds tar command
* Clarify some pytest stuff
* Offer alternative to Gitter
* Outlines steps for integration tests more clearly
* Adds filenaming convention for outputs files
* Ask not to rewrite history
* Adds two reviewer rule

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>
Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* docs: add eurunuela as a contributor (#504)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: add dowdlelt as a contributor (#505)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* [FIX] Make bi-sided clustering default (#331)

* Change default thresholding to bi-sided.

We should treat positively and negatively weighted voxels separately
when performing cluster-extent thresholding.

* Update license in zenodo

* [TST] Expand parameters tested in integration tests (#502)

* Add args to integration tests.

* Fix import error.

* Fix 5-echo test.

* Move rerun into another directory.

* Fix outputs.

* Fix...

* Dummy commit.

* [FIX, TST] Fix the failing tests (#518)

* Change requirements.

* Change env checksums.

* Improve documentation for debugging.

* [DOC] Improve documentation of computefeats2 (#458)

* adding more doc to computefeats2

* Added the default option add_const=False for user-friendliness

* changes following PR review & linter check

* Update tedana/stats.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Update tedana/stats.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Update tedana/stats.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

Co-authored-by: Elizabeth DuPre <emd222@cornell.edu>

* [TST] Remove testing directory from coverage tests (#496)

* Remove testing directory from coverage tests

* Removes some more tests

* Removes setup.py from coverage ignore

* Ignores info.py

* [ENH, REF] Allow re-running without manacc and reorder args (#508)

* Reorder tedana workflow arguments

Broadly reorder them from early to late in the workflow, but also
grouping related arguments together. Add a group for re-running the
workflow.

* Remove unnecessary check.

Data is a list from the CLI and io.load_data will convert a string to
list anyway. Plus io.load_data will raise an error if the file doesn’t
exist.

* Allow re-running workflow without manacc.

I.e., if manacc is not supplied, but ctab is, then use the
classifications from ctab.

* Address @dowdlelt's review.

* [ENH] Add t2smap argument for optional recalculated T2* map (#408)

* Add t2smap argument

Also, move rerunning-related arguments into their own subgroup and
allow rerunning *without* manacc (i.e., if manacc is not supplied, but
ctab is, then use the classifications from ctab.

* Update docs a big.

* Fix log message.

* Reorganize workflow arguments to group related params together.

* Get T2* re-running working.

* Replace `.nii` in workflow with `.nii.gz`.

* Fix args.

* Add manacc test.

* Fix t2s naming.

* Add fit type back in.

* Fix bad merge.

* [REF] Add out_dir argument to filewriting functions (#500)

* Add out_dir argument to gscontrol functions.

* Add out_dir argument to io functions.

* Remove unnecessary chdir call.

* Fix removed files.

* Fix outputs.

* Fix io.filewrite.

* Fix filewrite.

* [FIX, DOC] Reorganize and improve documentation (#530)

* Fix typos.

* Miscellaneous doc cleanup.

* Fix PCA/ICA links (closes #480).

* Remove outdated output from table.

* Move acquisition-related sections to one page.

Also, move considerations into multi-echo page, move resources from
considerations into new “resources” page, and move publications into
new “acquisition” page.

* Add info about quantitative T2* mapping (closes #464).

* Add link to ME-fMRI sequences OSF project.

* Address review.

* Add @handwerkerd's recommendation for the protocols.

* Add @handwerkerd's text about T2* mapping.

* Fix links.

* Add comment about copy.

Using copy makes more sense here than re-implementing what I did in
#498.

* Darn so I forgot to save when I resolved the conflict.

* Capping is already in the decay module.

* Fix long line.

* Draft check_mask function.

* Fix mismatch between metrics and decision tree.

Also calculate metrics in the actual workflow.

And also documentation.

* Fix style problem.

* Add while loop escape parameter.

* Reduce stalebot aggression. (#535)

* [DOC] Add "is it maintained" badges (#536)

* [FIX] Remove colons from log filename (#542)

* Remove colons from log-file name.

* Update integration test regex for finding log files.

* [TST] Add tests for the workflow CLIs (#538)

* Change rerun tests to use the CLI.

* Add t2smap CLI test.

* FIX

* No but fix.

* Address @rmarkello's review.

* [ENH] Output and load T2* maps in seconds (#525)

* Output and load in T2* maps in seconds.

* Print info about T2* in seconds.

* Add comments to trigger CI.

* Maybe test t2smap arg.

* Add sec2millisec and millisec2sec functions.

* Apply @jbteves' suggestions from code review

Add millisec2sec and sec2millisec to t2smap.

Co-Authored-By: Joshua Teves <jbtevespro@gmail.com>

* Add functions to API doc page.

* Fix bad import.

* Fix mistake.

Co-authored-by: Joshua Teves <jbtevespro@gmail.com>

* [FIX,TST] Adds unit tests for ma_pca functions and fixes a bug in ma_pca (#549)

* Adds unit tests for ma_pca functions and fixes a bug in ma_pca

* Adds trivwin false check on test_check_order

* Update tedana/tests/test_mapca.py

Co-Authored-By: Taylor Salo <tsalo006@fiu.edu>

Co-authored-by: Taylor Salo <tsalo006@fiu.edu>

* [FIX] Use mask, when provided, in t2smap workflow. (#545)

* [DOC] Updates the TEDPCA section following changes in tedana v0.0.8 (#551)

* Adds missing reference

* Adds missing line break

* Reduced the math-wizardry of the MA PCA description

* Gives iid its full name

* Update docs/approach.rst

* [ENH] Control number of threads with threadpoolctl (#537)

* Let's give threadpoolctl a try.

* Group related imports together and sort by length like the artists we are.

* Apparently I have to import things if I want to use them.

* Switch to using argparse function for e5 integration test re-run.

* Revert.

* Apply suggestions from code review

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Partially address review.

* Finish addressing review.

* Update tedana/workflows/t2smap.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

Co-authored-by: Ross Markello <rossmarkello@gmail.com>

* [DOC] Adds PCA documentation change that was missing (#554)

* [DOC] Updates the TEDPCA section following changes in tedana v0.0.8

* Adds missing reference

* Adds missing line break

* Reduced the math-wizardry of the MA PCA description

* Gives iid its full name

* Update docs/approach.rst

Co-Authored-By: Taylor Salo <tsalo006@fiu.edu>

* Update docs/approach.rst

Co-Authored-By: Taylor Salo <tsalo006@fiu.edu>

* Assess PR review comments

Co-authored-by: Taylor Salo <tsalo006@fiu.edu>

* [FIX] Drop use of eimask (#555)

This is a quick bug-fix, but we will ultimately probably incorporate
the eimask into the initial adaptive masking at the beginning of the
workflow.

* [REF] Include daysUntilStale and daysUntilClose in stalebot message (#559)

* [ENH] Only use good echoes for metric calculation/optimal combination (#358)

* Only use good echoes for metric calculation and optimal combination.

* Change variable name.

* A bit more memory management.

* Fix.

* Fix tests.

* Fix style.

* Limit mask to adaptive_mask >= 3

* Fix make_adaptive_mask

* Fix test.

* Update outputs.

* Remove old file.

* Revert some variable name changes.

* Revert some more.

* Fix style issues with test.

* Add constant when calculating betas.

Removing this seemed to cause the breaking test in the last merge commit.

* Drop extra components from outputs file.

* Improve tedpca docstring.

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Improve description of adaptive mask.

* Change empty to unstable.

* Update tedana/combine.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Update tedana/combine.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Update tedana/combine.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

Co-authored-by: Elizabeth DuPre <emd222@cornell.edu>

* [FIX] Use SNR for PAID instead of mean data (#560)

* [REF] Update t2smap workflow for fMRIPrep compatibility (#557)

* Add out-dir argument to t2smap workflow.

Also move logging setup from _main into t2smap_workflow.

* Change t2smap workflow output files.

* I hate tests.

* Oh my tests are the worst.

* Fix the CLI test as well.

* [FIX] Correct t2smap outputs (#562)

* Fix BEP001-compatible output names.

* Arbitrary change to allow PR.

* [FIX] Fix t2smap optimal combination (#566)

* Fix t2smap optcom

Introduced when I changed make_optcom’s arg from mask to adaptive mask
in #358.

* Add t2smap integration test.

* Update acquisition.rst to include information for Philips scanners (#579)

* Update acquisition.rst

Include description for Philips users

* docs: add mjversluis as a contributor (#580)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* Empty

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* [DOC] multi-echo reports (#457)

* Added html template for report

* doc: initial commit of reporting template

* doc: save out html for testing

* fix: add missing bokeh js script

* fix: unescape HTML ugly way

* fix: add missing cdn's

* enh: switch to generate_report structure

* sty: switch back to pure CSS from bootstrap

* fix: differently update template for content

* sty: add jupyter notebooks to git ignore

* enh:initial commit of dynamic plots

* fix: patch unpaired bracket

* enh:modularized dynamic kappa/rho plots

* enh:docstrings added to KappaRho_DynPlot.py

* Force figures default, fold viz into reporting module

* enh:TS and Spectrum are now dynamic plots

* sty: initial refactor of dynamic figures

* fix: re-introduce func to load comp_table

* sty: finalize rough refactor

* fix: patch linting errors

* doc: continue refactor

* Advanced on dynamic_figures

* Made the refactored code work

* fix: new year, new approach

* tmp: non-functioning reporting code

* Fixes bug

* Fixes bug

* Added new function to generate html report and removed tempita calls

* Added FFT and time series plots

* Made template subsitute work and updated necessary bokeh version

* Changes html title

* remove time series, fft plots

* fix: remove unescapes

* fix: patch incorrect imports

* fix: add missing bokeh import

* fix: spelling mistake 🤦

* fix: reflect reorg in get_coeffs call

* fix: correct expected test outputs

* fix: don't designate file path when saving report

* fix: combine generate, html report functions

* fix: ignore missing columns in df.drop, to better handle multiple params

* Dynamic figures are now two rows, static figure is on the right. Removed the cute dog link and made adding report.txt text to bottom of report automatic

* Added new line after References in report.txt

* Removes BeautifulSoup dependency in favor of an object tag and changes some CSS styles

* enh: switch to grid layout, style About section, add links to navbar

* doc: update no-png to no-reports

* modifiation of setup.py to properly install all reporting directories

* Use relative path for static figures on report

* Add version check for bokeh figures

Co-authored-by: smoia <s.moia@bcbl.eu>
Co-authored-by: Javier Gonzalez-Castillo <javiergcas@gmail.com>
Co-authored-by: eurunuela <enekouru@gmail.com>

* Escape earlier.

* Fix inescapable while loop.

* Update outputs.

* Log in CI.

* Add smoke tests for metric functions.

* A little cleanup.

* Apply adaptive masking to metrics.

* Work around get_coeffs idiosyncrasy.

* Fix tests.

* Ugh, fix.

* Drop old metrics file.

Co-authored-by: Taylor Salo <tsalo006@fiu.edu>
Co-authored-by: Logan <logan.dowdle@gmail.com>
Co-authored-by: Chris Markiewicz <markiewicz@stanford.edu>
Co-authored-by: Eneko Uruñuela <13706448+eurunuela@users.noreply.github.com>
Co-authored-by: Joshua Teves <jbtevespro@gmail.com>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ross Markello <rossmarkello@gmail.com>
Co-authored-by: Cesar Caballero Gaudes <c.caballero@bcbl.eu>
Co-authored-by: mjversluis <32125111+mjversluis@users.noreply.github.com>
Co-authored-by: smoia <s.moia@bcbl.eu>
Co-authored-by: Javier Gonzalez-Castillo <javiergcas@gmail.com>
Co-authored-by: eurunuela <enekouru@gmail.com>
tsalo added a commit that referenced this pull request Jun 14, 2021
* [REF] Modularize metric calculation (#447)

* Reorganize metrics.

* Some more work on organizing metrics.

* Add signal_minus_noise_z metric.

* Variable name change.

* Move comptable.

* Move T2* cap into decay function.

* Split up metric files.

* Adjust cluster-extent thresholding to match across maps.

* Partially address review.

Lots of great refactoring by @rmarkello.

* Make DICE broadcastable.

* Clean up signal-noise metrics and fix compute_countnoise.

* Simplify calculate_z_maps.

* Fix dice (thanks @rmarkello)

* Improve documentation.

* Fix import.

* Fix imports.

* Get modularized metrics mostly working.

* Fix bugs in metric calculations.

All metrics should be calculated on *masked* data. Any metric maps
should also be masked.

* Revert changes to decision tree.

* Finish reverting.

* Fix viz.

* Fix style issues

* More???

* Fix bug in generate_metrics.

* Add initial tests.

* Improve docstrings, add shape checks, and reorder functions.

* Fix assertions.

* Fix style issue.

* Add metric submodules to API docs.

* Improve reporting for T_to_Z transform.

* Fix bugs in new modularized dependence metrics.

* Revert "[REF] Modularize metric calculation (#447)" (#474)

This reverts commit 913cd4c.

* [REF] Modularize metrics (#475)

* Reorganize metrics.

* Some more work on organizing metrics.

* Add signal_minus_noise_z metric.

* Variable name change.

* edited gitignore after testing

* Revert "edited gitignore after testing"

This reverts commit 28098e1.

* fix the +0 -0 absurdity and actually commit

* silly underscore go away

* style fix

* I swear I can spell things.

* Move comptable.

* more style

* Move T2* cap into decay function.

* Split up metric files.

* Adjust cluster-extent thresholding to match across maps.

* Partially address review.

Lots of great refactoring by @rmarkello.

* Make DICE broadcastable.

* Clean up signal-noise metrics and fix compute_countnoise.

* Simplify calculate_z_maps.

* Fix dice (thanks @rmarkello)

* use index, doesn't have component

* add the scree to the outputs

* Improve documentation.

* Fix import.

* Fix imports.

* Get modularized metrics mostly working.

* Fix bugs in metric calculations.

All metrics should be calculated on *masked* data. Any metric maps
should also be masked.

* Revert changes to decision tree.

* Finish reverting.

* Fix viz.

* Fix style issues

* More???

* Fix bug in generate_metrics.

* Add initial tests.

* Improve docstrings, add shape checks, and reorder functions.

* Fix assertions.

* Fix style issue.

* Add metric submodules to API docs.

* Improve reporting for T_to_Z transform.

* Fix bugs in new modularized dependence metrics.

* [MNT] Drop versioneer from requirements (#481)

* MNT: Drop versioneer from requirements

The versioneer package is not a requirement to use versioneer.

* MNT: Add versioneer to a new "dev" extra

* [ENH] Adds maPCA decomposition algorithm (#435)

* Create fix/decomp branch

* Started writing GIFT version in Pythonn as we found it selects a reasonable number of components

* Advanced on new PCA computation

* Solved NAN issues and added testing data

* Solved est_indp_sp bug

* PCA is SOLVED! Hooray!

* PR request ready version of the PCA fix

* fix: avoid circular imports

* Bug fixes and started working on docstrings

* [FIX] Clean up some variables in GIFT PCA (#453)

* Added version argument (#415)

* Added version argument

* changed import of __version__

* [REF] No pytest_cache dir

* [ENH] Dockerfile for dev testing

* [DOC] Add docs for code testing to CONTRIBUTING

* [REF] Docker org can't have hyphens

Just use tedana/tedana-dev namespace

* Changed default export in gzipped nifti (#416)

* Changed default export in gzipped nifti

* Updated extension of files in tests

* [FIX] Update typo in .gitignore

Co-Authored-By: Joshua Teves <jbtevespro@gmail.com>

* [REF, DOC] Use logging to generate reports (#424)

* Use logging for report/references generation.

* Improve ContextFilter docstring.

* Remove broken newlines.

* Make the style good.

* [ENH][TST] Overhauls CI completely (#418)

* Adds integration and five echo skipping

* Style fixes

* Updates config for CircleCI

* Attempts to fix YML

* [TEST] Update Dockerfile to match new integr tests

* [TEST] Fixes integration tests in Docker image

* [FIX] Remove intermediate IO files

* Resolves merge conflict, adds output check

* Some fixes

* [TEST] Updates dev_tool testing infra

* [TEST] Fixes pytest integration path checking

* [TEST] CircleCI uses Docker image to run tests

* [FIX] Minor dev_tool issues for CircleCI

* [TEST] Use variable for integration test filename

* Attempts to fix CircleCI style check

* Revert "Attempts to fix CircleCI style check"

This reverts commit 769f4b7.

* Attempt to fix tput call

* Adds checkout to code in YML

* [TEST] Integration tests run in parallel

* [TEST] Separate data downloads from Docker build

* [TEST] Update integration test data path

* [TEST] CircleCI uses good Docker

* [TEST] No version check in circleci

* [TEST] Checkout for get_data / style check

* Attempts to fix integration test inclusion

* [TEST] Checkout for get_data / style check

* [FIX] Fix circleci config hopefully

* [FIX] No / workdir for circleci machine

* [FIX] Use ~ for coverage in circleci

* Switches integration tests to truncated length data

* [FIX] Actually merge coverage files

* [FIX] Coverage cache path circleci

* [TEST] Integration test outputs in tests/data

* [FIX] circleci config bug

* [TEST] Major testing infra overhaul

Docker image considerably slimmed down (only test python 3.6 locally),
added new dev_requirements.txt to make conda yaml files obsolete, added
Makefile to make testing easier locally (if you aren't using the Docker
image), and removed integration test data downloads from separate script
and into the integration tests themselves

* [TEST] Massive CircleCI config regression

@tsalo had it right --- moving towards a fully Dockerized implementation
was not the way forward for a simple Python package.

* [TEST] Better integration testing?

At least, more equivalent to what was happening before, where we check
that ONLY the expected output files are generated (no more, no less)

* [FIX] CircleCI workflow issue

* [MNT] No flake8-putty

* [FLK] New flake8 error detected

* [TEST] Run style check separately

@leej3 said it's not fair to stop running tests for a few minor style
errors, and he's usually right so....

* [TEST] Py37 for all non-unit test stuff

* [WIP,TEST,DOC] Builds docs in CircleCI (#428)

* [REF] Fix up dev vs non-dev requirements.txt

* [TEST] Build docs in CircleCI

Also modifies the building of the py37 environment a bit since it's
shared between so many things

* [REF] Change tab-delimited files from txt extension to tsv (#429)

* Change comptables and log from txt to tsv.

* Prevents shell expansion in API (#431)

* enh: add stale-bot (#430)

* edited gitignore after testing

* Revert "edited gitignore after testing"

This reverts commit 28098e1.

* fixing typo and clarity

* cleaning up approach introduction

* more cleanup in approach

* adding initial plot to pubs page

* correcting plots

* removing comment parts

* getting live plots working on publication page

* clean up and adding more WIP details

* completing live TE plot from spreasheet

* changing outputs to nii.gz

* adding TR and Vox dim subplots

* initial adding of output details

* fixing tables

* rearranging to considerations and recomendations

* seperating out considerations section

* technically spelling things correct

* started fixing titles

* addinf figures for what is ME page

* title clarification

* Add information about GE

* adding mutliecho questions to the FAQ

* initial adding to multiecho

* multiecho page figures and explanations

* pipeline and phsyics updated

* typo

* fix headings

* possibly clean latex?

* we have eight echoes

* more details in approach

* title change

* adding software details

* clean up of multiecho

* additional considerations!

* typo

* update plots

* due credit in faq

* more details on multi echo, usage

* tedana does accept BRIK/HEAD

* someone wanted sentences seperated

* life by a thousand little edits

* GrAmMaRs

* other software!

* links to api in approach

* white space?

* [ENH] Make png default (#427)

* Makes --png default, adds --nopng

* Fixes integration test for --nopng

* Adds correction to integration test outputs

* Update docs/faq.rst

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* MRI scanners != BBQ

* Update docs/approach.rst

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Update docs/approach.rst

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Apply suggestions from code review, thanks a million

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* echo cleanup, and kundu 3 banish

* noted png default

* completely changed the QC section

* pls wrk

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* docs: add jbteves as a contributor (#442)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add eurunuela as a contributor (#441)

* docs: update README.md

* docs: update .all-contributorsrc

* [ENH][TST] Feature/parallel integration (#437)

* Adjusts makefile to include three-echo and five-echo, remove integration
* Adjusts CircleCI config to do the same as makefile 
* Removes doc auto-building via CircleCI

* [FIX] Adds check for just one component (#405)

* Adds check for just one component

* [ENH] Consolidate stats unit tests and fix linting errors in tests (#421)

* Consolidates stats unit tests
* Changes to simpler assert for stats errors
* Oof linting

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Clean up some variables.

* Fix output name.

* Fix bugs and use TruncatedSVD in GIFT.

* Normalization of data added

* doc: fix linting errors

* Second if statement in _checkOrder does not check for None values now, as these should never be given to the function.

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Style editing to gift_pca.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Style editing to gift_pca.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Removed silly comment inherited from MATLAB

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Removed print statement int gift_pca.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Commented TruncatedSVD as it does not provide the functionality we are looking for. Also, made some edits after the comments from Elizabeth

* Removed unused import

* Changed some of the print statements to make them more user friendly

* Adds documentation

* Fixes PCA memory madness

* Fixes linter errors

* Now accounting for imprecission in kurtosis calculation

* Edited autocorr docstring

* GIFT PCA doesn't use the var normalized now in order to get the same number of components as the original GIFT algorithm. This is something we should definitely discuss

* Corrections to style

* Changed test output expected

* Removed GIFT notebook

* Made MDL the default and added GIFT reference

* Removed GIFT testing data

* Changes as commented in PR review

* Style fix

* Changed variable names to make them more readble

* Style fix

* Style fix

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Changes suggested in PR review

* More changes based on PR review suggestions

* Changes to workflows/tedana.py based on PR review suggestions

* Changes to decomposition/pca.py based on PR review suggestions

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Update tedana/decomposition/gift_pca.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* More review changes

* Style fixes

* Finished with PR review suggestinos

* Update tedana/decomposition/gift.py

Co-Authored-By: Taylor Salo <tsalo006@fiu.edu>

* Update tedana/decomposition/gift.py

Co-Authored-By: Taylor Salo <tsalo006@fiu.edu>

* Renamed gift to ma_pca and added some math notes

* Added more maths-related comments

* Renamed ma_pca function

* Added unit test for maPCA and fixed a typo in ma_pca.py

* Added unit test for maPCA and fixed a typo in ma_pca.py

* Added unit test for ent_rate_sp inside maPCA

* Added test for constant input to ent_rate_sp

* Documentation fix

Co-Authored-By: Joshua Teves <jbtevespro@gmail.com>

* Documentation fix

Co-Authored-By: Joshua Teves <jbtevespro@gmail.com>

* Removed if statements in ent_rate_sp as they were never going to be accessed in our case. Also addressed some PR review comments.

* Style fix

* Update tedana/decomposition/ma_pca.py

Co-Authored-By: Joshua Teves <jbtevespro@gmail.com>

* Update tedana/decomposition/ma_pca.py

Co-Authored-By: Joshua Teves <jbtevespro@gmail.com>

* Addresses documentation suggestions

* [TST] Expands integration (#482)

* Expands integration testing to include mapca and several of its options

* [REF] Remove the sourceTEs option (#493)

* [REF] Removes mle option (#495)

* Removes mle option

* [REF] Remove confusing variable copy (#498)

* mmix -> mmix_new

* Change variable name.

* add new plot to all tests

* removing to_numpy(), plt. to fig.

* docs: add Islast as a contributor (#503)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* [DOC] Adds developer guideline start (#446)

* Adds developer guideline start
* Modifies CONTRIBUTING
* Fixes dead link, removes project board
* Adds more thorough developing guidelines
* Fix lack of linting
* Updates dev requirements
* Adds flake8 instructions
* Updates config with correct CI version
* Adds manual selection of artifiacts through CircleCI UI
* Adds tar command
* Clarify some pytest stuff
* Offer alternative to Gitter
* Outlines steps for integration tests more clearly
* Adds filenaming convention for outputs files
* Ask not to rewrite history
* Adds two reviewer rule

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>
Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* docs: add eurunuela as a contributor (#504)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: add dowdlelt as a contributor (#505)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* [FIX] Make bi-sided clustering default (#331)

* Change default thresholding to bi-sided.

We should treat positively and negatively weighted voxels separately
when performing cluster-extent thresholding.

* Update license in zenodo

* [TST] Expand parameters tested in integration tests (#502)

* Add args to integration tests.

* Fix import error.

* Fix 5-echo test.

* Move rerun into another directory.

* Fix outputs.

* Fix...

* Dummy commit.

* [FIX, TST] Fix the failing tests (#518)

* Change requirements.

* Change env checksums.

* Improve documentation for debugging.

* [DOC] Improve documentation of computefeats2 (#458)

* adding more doc to computefeats2

* Added the default option add_const=False for user-friendliness

* changes following PR review & linter check

* Update tedana/stats.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Update tedana/stats.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Update tedana/stats.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

Co-authored-by: Elizabeth DuPre <emd222@cornell.edu>

* [TST] Remove testing directory from coverage tests (#496)

* Remove testing directory from coverage tests

* Removes some more tests

* Removes setup.py from coverage ignore

* Ignores info.py

* [ENH, REF] Allow re-running without manacc and reorder args (#508)

* Reorder tedana workflow arguments

Broadly reorder them from early to late in the workflow, but also
grouping related arguments together. Add a group for re-running the
workflow.

* Remove unnecessary check.

Data is a list from the CLI and io.load_data will convert a string to
list anyway. Plus io.load_data will raise an error if the file doesn’t
exist.

* Allow re-running workflow without manacc.

I.e., if manacc is not supplied, but ctab is, then use the
classifications from ctab.

* Address @dowdlelt's review.

* [ENH] Add t2smap argument for optional recalculated T2* map (#408)

* Add t2smap argument

Also, move rerunning-related arguments into their own subgroup and
allow rerunning *without* manacc (i.e., if manacc is not supplied, but
ctab is, then use the classifications from ctab.

* Update docs a big.

* Fix log message.

* Reorganize workflow arguments to group related params together.

* Get T2* re-running working.

* Replace `.nii` in workflow with `.nii.gz`.

* Fix args.

* Add manacc test.

* Fix t2s naming.

* Add fit type back in.

* Fix bad merge.

* [REF] Add out_dir argument to filewriting functions (#500)

* Add out_dir argument to gscontrol functions.

* Add out_dir argument to io functions.

* Remove unnecessary chdir call.

* Fix removed files.

* Fix outputs.

* Fix io.filewrite.

* Fix filewrite.

* [FIX, DOC] Reorganize and improve documentation (#530)

* Fix typos.

* Miscellaneous doc cleanup.

* Fix PCA/ICA links (closes #480).

* Remove outdated output from table.

* Move acquisition-related sections to one page.

Also, move considerations into multi-echo page, move resources from
considerations into new “resources” page, and move publications into
new “acquisition” page.

* Add info about quantitative T2* mapping (closes #464).

* Add link to ME-fMRI sequences OSF project.

* Address review.

* Add @handwerkerd's recommendation for the protocols.

* Add @handwerkerd's text about T2* mapping.

* Fix links.

* Add comment about copy.

Using copy makes more sense here than re-implementing what I did in
#498.

* Darn so I forgot to save when I resolved the conflict.

* Capping is already in the decay module.

* Fix long line.

* Draft check_mask function.

* Fix mismatch between metrics and decision tree.

Also calculate metrics in the actual workflow.

And also documentation.

* Fix style problem.

* Add while loop escape parameter.

* Reduce stalebot aggression. (#535)

* [DOC] Add "is it maintained" badges (#536)

* [FIX] Remove colons from log filename (#542)

* Remove colons from log-file name.

* Update integration test regex for finding log files.

* [TST] Add tests for the workflow CLIs (#538)

* Change rerun tests to use the CLI.

* Add t2smap CLI test.

* FIX

* No but fix.

* Address @rmarkello's review.

* [ENH] Output and load T2* maps in seconds (#525)

* Output and load in T2* maps in seconds.

* Print info about T2* in seconds.

* Add comments to trigger CI.

* Maybe test t2smap arg.

* Add sec2millisec and millisec2sec functions.

* Apply @jbteves' suggestions from code review

Add millisec2sec and sec2millisec to t2smap.

Co-Authored-By: Joshua Teves <jbtevespro@gmail.com>

* Add functions to API doc page.

* Fix bad import.

* Fix mistake.

Co-authored-by: Joshua Teves <jbtevespro@gmail.com>

* [FIX,TST] Adds unit tests for ma_pca functions and fixes a bug in ma_pca (#549)

* Adds unit tests for ma_pca functions and fixes a bug in ma_pca

* Adds trivwin false check on test_check_order

* Update tedana/tests/test_mapca.py

Co-Authored-By: Taylor Salo <tsalo006@fiu.edu>

Co-authored-by: Taylor Salo <tsalo006@fiu.edu>

* [FIX] Use mask, when provided, in t2smap workflow. (#545)

* [DOC] Updates the TEDPCA section following changes in tedana v0.0.8 (#551)

* Adds missing reference

* Adds missing line break

* Reduced the math-wizardry of the MA PCA description

* Gives iid its full name

* Update docs/approach.rst

* [ENH] Control number of threads with threadpoolctl (#537)

* Let's give threadpoolctl a try.

* Group related imports together and sort by length like the artists we are.

* Apparently I have to import things if I want to use them.

* Switch to using argparse function for e5 integration test re-run.

* Revert.

* Apply suggestions from code review

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

* Partially address review.

* Finish addressing review.

* Update tedana/workflows/t2smap.py

Co-Authored-By: Ross Markello <rossmarkello@gmail.com>

Co-authored-by: Ross Markello <rossmarkello@gmail.com>

* [DOC] Adds PCA documentation change that was missing (#554)

* [DOC] Updates the TEDPCA section following changes in tedana v0.0.8

* Adds missing reference

* Adds missing line break

* Reduced the math-wizardry of the MA PCA description

* Gives iid its full name

* Update docs/approach.rst

Co-Authored-By: Taylor Salo <tsalo006@fiu.edu>

* Update docs/approach.rst

Co-Authored-By: Taylor Salo <tsalo006@fiu.edu>

* Assess PR review comments

Co-authored-by: Taylor Salo <tsalo006@fiu.edu>

* [FIX] Drop use of eimask (#555)

This is a quick bug-fix, but we will ultimately probably incorporate
the eimask into the initial adaptive masking at the beginning of the
workflow.

* [REF] Include daysUntilStale and daysUntilClose in stalebot message (#559)

* [ENH] Only use good echoes for metric calculation/optimal combination (#358)

* Only use good echoes for metric calculation and optimal combination.

* Change variable name.

* A bit more memory management.

* Fix.

* Fix tests.

* Fix style.

* Limit mask to adaptive_mask >= 3

* Fix make_adaptive_mask

* Fix test.

* Update outputs.

* Remove old file.

* Revert some variable name changes.

* Revert some more.

* Fix style issues with test.

* Add constant when calculating betas.

Removing this seemed to cause the breaking test in the last merge commit.

* Drop extra components from outputs file.

* Improve tedpca docstring.

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Improve description of adaptive mask.

* Change empty to unstable.

* Update tedana/combine.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Update tedana/combine.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

* Update tedana/combine.py

Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu>

Co-authored-by: Elizabeth DuPre <emd222@cornell.edu>

* [FIX] Use SNR for PAID instead of mean data (#560)

* [REF] Update t2smap workflow for fMRIPrep compatibility (#557)

* Add out-dir argument to t2smap workflow.

Also move logging setup from _main into t2smap_workflow.

* Change t2smap workflow output files.

* I hate tests.

* Oh my tests are the worst.

* Fix the CLI test as well.

* [FIX] Correct t2smap outputs (#562)

* Fix BEP001-compatible output names.

* Arbitrary change to allow PR.

* [FIX] Fix t2smap optimal combination (#566)

* Fix t2smap optcom

Introduced when I changed make_optcom’s arg from mask to adaptive mask
in #358.

* Add t2smap integration test.

* Update acquisition.rst to include information for Philips scanners (#579)

* Update acquisition.rst

Include description for Philips users

* docs: add mjversluis as a contributor (#580)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* Empty

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* [DOC] multi-echo reports (#457)

* Added html template for report

* doc: initial commit of reporting template

* doc: save out html for testing

* fix: add missing bokeh js script

* fix: unescape HTML ugly way

* fix: add missing cdn's

* enh: switch to generate_report structure

* sty: switch back to pure CSS from bootstrap

* fix: differently update template for content

* sty: add jupyter notebooks to git ignore

* enh:initial commit of dynamic plots

* fix: patch unpaired bracket

* enh:modularized dynamic kappa/rho plots

* enh:docstrings added to KappaRho_DynPlot.py

* Force figures default, fold viz into reporting module

* enh:TS and Spectrum are now dynamic plots

* sty: initial refactor of dynamic figures

* fix: re-introduce func to load comp_table

* sty: finalize rough refactor

* fix: patch linting errors

* doc: continue refactor

* Advanced on dynamic_figures

* Made the refactored code work

* fix: new year, new approach

* tmp: non-functioning reporting code

* Fixes bug

* Fixes bug

* Added new function to generate html report and removed tempita calls

* Added FFT and time series plots

* Made template subsitute work and updated necessary bokeh version

* Changes html title

* remove time series, fft plots

* fix: remove unescapes

* fix: patch incorrect imports

* fix: add missing bokeh import

* fix: spelling mistake 🤦

* fix: reflect reorg in get_coeffs call

* fix: correct expected test outputs

* fix: don't designate file path when saving report

* fix: combine generate, html report functions

* fix: ignore missing columns in df.drop, to better handle multiple params

* Dynamic figures are now two rows, static figure is on the right. Removed the cute dog link and made adding report.txt text to bottom of report automatic

* Added new line after References in report.txt

* Removes BeautifulSoup dependency in favor of an object tag and changes some CSS styles

* enh: switch to grid layout, style About section, add links to navbar

* doc: update no-png to no-reports

* modifiation of setup.py to properly install all reporting directories

* Use relative path for static figures on report

* Add version check for bokeh figures

Co-authored-by: smoia <s.moia@bcbl.eu>
Co-authored-by: Javier Gonzalez-Castillo <javiergcas@gmail.com>
Co-authored-by: eurunuela <enekouru@gmail.com>

* Escape earlier.

* Fix inescapable while loop.

* Update outputs.

* Log in CI.

* Add smoke tests for metric functions.

* A little cleanup.

* Apply adaptive masking to metrics.

* Work around get_coeffs idiosyncrasy.

* Fix tests.

* Ugh, fix.

* Drop old metrics file.

Co-authored-by: Taylor Salo <tsalo006@fiu.edu>
Co-authored-by: Logan <logan.dowdle@gmail.com>
Co-authored-by: Chris Markiewicz <markiewicz@stanford.edu>
Co-authored-by: Eneko Uruñuela <13706448+eurunuela@users.noreply.github.com>
Co-authored-by: Joshua Teves <jbtevespro@gmail.com>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ross Markello <rossmarkello@gmail.com>
Co-authored-by: Cesar Caballero Gaudes <c.caballero@bcbl.eu>
Co-authored-by: mjversluis <32125111+mjversluis@users.noreply.github.com>
Co-authored-by: smoia <s.moia@bcbl.eu>
Co-authored-by: Javier Gonzalez-Castillo <javiergcas@gmail.com>
Co-authored-by: eurunuela <enekouru@gmail.com>

* Use adaptive mask approach from #635.

* Fix test.

* Fix docstrings.

* Clean up style.

* Shape checks and more cleanup.

* Coerce tes to array.

* Clean up tests.

* Ignore W503.

We should *stop* ignoring W504.

* Merge main in

* Switch R2 -> T2 in filenames

* Make RTD happy

* Please, pretty please, RTD

* Un-regresses changes to selection

* Another attempt to placate capricious RTD deities

* Enforce previous metric orders on comptable

* Makes clustering less smart to align with main

* Fix style

* Align with Eneko changes

* Reorder component table labels correctly

Co-authored-by: Elizabeth DuPre <emd222@cornell.edu>
Co-authored-by: Logan <logan.dowdle@gmail.com>
Co-authored-by: Chris Markiewicz <markiewicz@stanford.edu>
Co-authored-by: Eneko Uruñuela <13706448+eurunuela@users.noreply.github.com>
Co-authored-by: Joshua Teves <jbtevespro@gmail.com>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ross Markello <rossmarkello@gmail.com>
Co-authored-by: Cesar Caballero Gaudes <c.caballero@bcbl.eu>
Co-authored-by: mjversluis <32125111+mjversluis@users.noreply.github.com>
Co-authored-by: smoia <s.moia@bcbl.eu>
Co-authored-by: Javier Gonzalez-Castillo <javiergcas@gmail.com>
Co-authored-by: eurunuela <enekouru@gmail.com>
Co-authored-by: Joshua Teves <joshua.teves@nih.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring issues proposing/requesting changes to the code which do not impact behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove chdir in tedana_workflow
3 participants