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

package: setup.py and reorganize #50

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

WillForan
Copy link
Contributor

@WillForan WillForan commented Sep 27, 2020

This uses the fork from @rtrhd (#8 ) as a template for packaging, but it does not update the internal structure. Hopefully it can be easily audited and pulled -- if moving toward a pypi installation is in the roadmap (issue #38).

  • ICA_AROMA.py and ICA_AROMA_functions.py were renamed and moved inside the package directory. ICA_AROMA.py is now nested inside a massive function. Most of the changes are just an indent from this. See git diff -w --word-diff=color f1358e0 7e491a7 -- ica_aroma/ica_aroma.py for a clean view of the changes
  • __init__.py exists with a function to find the module path where *_mask.nii.gz will reside.
  • ICA_AROMA.py (now ica_aroma/ica_aroma.py) needed two changes to be packaged:
    1. instead of setwd using __file__, we use the module path (__init__.py:get_data_path())
    2. there's a little kludge to deal with passing sys.argv into the new primary function. I think argv.pop needs to be run after initializing the parser to keep the script name argv[0] from being used as a script argument.
  • tests (with pytest) for the two changes are in tests/tests_run.py. There's a Makefile for setup. (make test), using refin input images from @rtrhd

the branch can be installed with pip like

pip install git+https://github.com/WillForan/ICA-AROMA.git@maartenmennes-setup.py --user -U
ica_aroma # prints usage
```

using rtrhd/ICA-AROMA as a template
setup.py can use new function as "console_scripts"
get_data_path() is used instead of abspath(__file__) because the script location is no longer the module/data location
Makefile to run tests (and get data for tests)
🐛 also bug fix with "argv.pop" for ica_aroma_cli argv=sys.argv change
@WillForan WillForan changed the title add setup.py and move files around to make pip installable package package: setup.py and reorganize Sep 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants