mapca
Advanced tools
| # Python CircleCI 2.1 configuration file | ||
| # | ||
| # Check https://circleci.com/docs/2.0/language-python/ for more details | ||
| # | ||
| version: 2.1 | ||
| orbs: | ||
| codecov: codecov/codecov@1.0.5 | ||
| jobs: | ||
| makeenv_38: | ||
| docker: | ||
| - image: continuumio/miniconda3 | ||
| working_directory: /tmp/src/mapca | ||
| steps: | ||
| - checkout | ||
| - restore_cache: | ||
| key: conda-py38-v1-{{ checksum "pyproject.toml" }} | ||
| - run: | ||
| name: Generate environment | ||
| command: | | ||
| if [ ! -d /opt/conda/envs/mapca_py38 ]; then | ||
| conda create -yq -n mapca_py38 python=3.8 | ||
| source activate mapca_py38 | ||
| pip install .[tests] | ||
| fi | ||
| - save_cache: | ||
| key: conda-py38-v1-{{ checksum "pyproject.toml" }} | ||
| paths: | ||
| - /opt/conda/envs/mapca_py38 | ||
| unittest_39: | ||
| docker: | ||
| - image: continuumio/miniconda3 | ||
| working_directory: /tmp/src/mapca | ||
| steps: | ||
| - checkout | ||
| - restore_cache: | ||
| key: conda-py39-v1-{{ checksum "pyproject.toml" }} | ||
| - run: | ||
| name: Generate environment | ||
| command: | | ||
| apt-get update | ||
| apt-get install -yqq make | ||
| if [ ! -d /opt/conda/envs/mapca_py39 ]; then | ||
| conda create -yq -n mapca_py39 python=3.9 | ||
| source activate mapca_py39 | ||
| pip install .[tests] | ||
| fi | ||
| - run: | ||
| name: Running unit tests | ||
| command: | | ||
| source activate mapca_py39 | ||
| py.test --ignore mapca/tests/test_integration.py --cov-append --cov-report term-missing --cov=mapca mapca/ | ||
| mkdir /tmp/src/coverage | ||
| mv /tmp/src/mapca/.coverage /tmp/src/coverage/.coverage.py39 | ||
| - save_cache: | ||
| key: conda-py39-v1-{{ checksum "pyproject.toml" }} | ||
| paths: | ||
| - /opt/conda/envs/mapca_py39 | ||
| - persist_to_workspace: | ||
| root: /tmp | ||
| paths: | ||
| - src/coverage/.coverage.py39 | ||
| unittest_310: | ||
| docker: | ||
| - image: continuumio/miniconda3 | ||
| working_directory: /tmp/src/mapca | ||
| steps: | ||
| - checkout | ||
| - restore_cache: | ||
| key: conda-py310-v1-{{ checksum "pyproject.toml" }} | ||
| - run: | ||
| name: Generate environment | ||
| command: | | ||
| apt-get update | ||
| apt-get install -yqq make | ||
| if [ ! -d /opt/conda/envs/mapca_py310 ]; then | ||
| conda create -yq -n mapca_py310 python=3.10 | ||
| source activate mapca_py310 | ||
| pip install .[tests] | ||
| fi | ||
| - run: | ||
| name: Running unit tests | ||
| command: | | ||
| source activate mapca_py310 | ||
| py.test --ignore mapca/tests/test_integration.py --cov-append --cov-report term-missing --cov=mapca mapca/ | ||
| mkdir /tmp/src/coverage | ||
| mv /tmp/src/mapca/.coverage /tmp/src/coverage/.coverage.py310 | ||
| - save_cache: | ||
| key: conda-py310-v1-{{ checksum "pyproject.toml" }} | ||
| paths: | ||
| - /opt/conda/envs/mapca_py310 | ||
| - persist_to_workspace: | ||
| root: /tmp | ||
| paths: | ||
| - src/coverage/.coverage.py310 | ||
| unittest_38: | ||
| docker: | ||
| - image: continuumio/miniconda3 | ||
| working_directory: /tmp/src/mapca | ||
| steps: | ||
| - checkout | ||
| - restore_cache: | ||
| key: conda-py38-v1-{{ checksum "pyproject.toml" }} | ||
| - run: | ||
| name: Running unit tests | ||
| command: | | ||
| apt-get update | ||
| apt-get install -y make | ||
| source activate mapca_py38 # depends on makeenv_38 | ||
| py.test --ignore mapca/tests/test_integration.py --cov-append --cov-report term-missing --cov=mapca mapca/ | ||
| mkdir /tmp/src/coverage | ||
| mv /tmp/src/mapca/.coverage /tmp/src/coverage/.coverage.py38 | ||
| - persist_to_workspace: | ||
| root: /tmp | ||
| paths: | ||
| - src/coverage/.coverage.py38 | ||
| integrationtest_38: | ||
| docker: | ||
| - image: continuumio/miniconda3 | ||
| working_directory: /tmp/src/mapca | ||
| steps: | ||
| - checkout | ||
| - restore_cache: | ||
| key: conda-py38-v1-{{ checksum "pyproject.toml" }} | ||
| - run: | ||
| name: Running unit tests | ||
| command: | | ||
| apt-get update | ||
| apt-get install -y make | ||
| source activate mapca_py38 # depends on makeenv_38 | ||
| py.test --log-cli-level=INFO --cov-append --cov-report term-missing --cov=mapca -k test_integration mapca/tests/test_integration.py | ||
| mkdir /tmp/src/coverage | ||
| mv /tmp/src/mapca/.coverage /tmp/src/coverage/.coverage.py38 | ||
| - persist_to_workspace: | ||
| root: /tmp | ||
| paths: | ||
| - src/coverage/.coverage.py38 | ||
| style_check: | ||
| docker: | ||
| - image: continuumio/miniconda3 | ||
| working_directory: /tmp/src/mapca | ||
| steps: | ||
| - checkout | ||
| - restore_cache: | ||
| key: conda-py38-v1-{{ checksum "pyproject.toml" }} | ||
| - run: | ||
| name: Style check | ||
| command: | | ||
| apt-get update | ||
| apt-get install -yqq make | ||
| source activate mapca_py38 # depends on makeenv38 | ||
| flake8 mapca | ||
| merge_coverage: | ||
| working_directory: /tmp/src/mapca | ||
| docker: | ||
| - image: continuumio/miniconda3 | ||
| steps: | ||
| - attach_workspace: | ||
| at: /tmp | ||
| - checkout | ||
| - restore_cache: | ||
| key: conda-py38-v1-{{ checksum "pyproject.toml" }} | ||
| - run: | ||
| name: Merge coverage files | ||
| command: | | ||
| apt-get update | ||
| apt-get install -yqq curl | ||
| source activate mapca_py38 # depends on makeenv38 | ||
| cd /tmp/src/coverage/ | ||
| coverage combine | ||
| coverage xml | ||
| - store_artifacts: | ||
| path: /tmp/src/coverage | ||
| - codecov/upload: | ||
| file: /tmp/src/coverage/coverage.xml | ||
| deploy: | ||
| docker: | ||
| - image: continuumio/miniconda3 | ||
| steps: | ||
| - checkout | ||
| - run: | ||
| name: init .pypirc | ||
| command: | | ||
| echo -e "[pypi]" >> ~/.pypirc | ||
| echo -e "username = $PYPI_USER" >> ~/.pypirc | ||
| echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc | ||
| - run: | ||
| name: create package | ||
| command: | | ||
| python setup.py sdist | ||
| python setup.py bdist_wheel | ||
| - run: | ||
| name: upload to pypi | ||
| command: | | ||
| pip install twine | ||
| twine upload dist/* | ||
| workflows: | ||
| version: 2.1 | ||
| build_test: | ||
| jobs: | ||
| - makeenv_38 | ||
| - unittest_39 | ||
| - unittest_310 | ||
| - unittest_38: | ||
| requires: | ||
| - makeenv_38 | ||
| - integrationtest_38: | ||
| requires: | ||
| - makeenv_38 | ||
| - style_check: | ||
| requires: | ||
| - makeenv_38 | ||
| - merge_coverage: | ||
| requires: | ||
| - unittest_38 | ||
| - unittest_39 | ||
| - unittest_310 | ||
| - deploy: | ||
| requires: | ||
| - merge_coverage | ||
| filters: | ||
| tags: | ||
| only: /[0-9]+\.[0-9]+\.[0-9]+(?:rc)?(?:[0-9]+)? | ||
| branches: | ||
| ignore: /.*/ |
+20
| codecov: | ||
| notify: | ||
| require_ci_to_pass: yes | ||
| coverage: | ||
| status: | ||
| project: | ||
| default: | ||
| # basic | ||
| target: 0 | ||
| threshold: 0 | ||
| patch: | ||
| default: | ||
| target: 0 | ||
| threshold: 0 | ||
| ignore: | ||
| - "mapca/tests/" | ||
| - "mapca/_version.py" | ||
| - "mapca/info.py" |
| mapca/_version.py export-subst |
| template: | | ||
| ## Release Notes | ||
| ## Changes | ||
| $CHANGES |
| # This workflow will upload a Python Package using Twine when a release is created | ||
| # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
| name: Upload Python Package | ||
| on: | ||
| release: | ||
| types: [created] | ||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: "3.8" | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install setuptools wheel twine build | ||
| - name: Build and publish | ||
| env: | ||
| TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
| run: | | ||
| python -m build --sdist --wheel --outdir dist/ . | ||
| twine upload dist/* |
+132
| # Byte-compiled / optimized / DLL files | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
| # C extensions | ||
| *.so | ||
| # Distribution / packaging | ||
| .Python | ||
| build/ | ||
| develop-eggs/ | ||
| dist/ | ||
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
| var/ | ||
| wheels/ | ||
| pip-wheel-metadata/ | ||
| share/python-wheels/ | ||
| *.egg-info/ | ||
| .installed.cfg | ||
| *.egg | ||
| MANIFEST | ||
| # PyInstaller | ||
| # Usually these files are written by a python script from a template | ||
| # before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
| *.manifest | ||
| *.spec | ||
| # Installer logs | ||
| pip-log.txt | ||
| pip-delete-this-directory.txt | ||
| # Unit test / coverage reports | ||
| htmlcov/ | ||
| .tox/ | ||
| .nox/ | ||
| .coverage | ||
| .coverage.* | ||
| .cache | ||
| nosetests.xml | ||
| coverage.xml | ||
| *.cover | ||
| *.py,cover | ||
| .hypothesis/ | ||
| .pytest_cache/ | ||
| # Translations | ||
| *.mo | ||
| *.pot | ||
| # Django stuff: | ||
| *.log | ||
| local_settings.py | ||
| db.sqlite3 | ||
| db.sqlite3-journal | ||
| # Flask stuff: | ||
| instance/ | ||
| .webassets-cache | ||
| # Scrapy stuff: | ||
| .scrapy | ||
| # Sphinx documentation | ||
| docs/_build/ | ||
| # PyBuilder | ||
| target/ | ||
| # Jupyter Notebook | ||
| .ipynb_checkpoints | ||
| # IPython | ||
| profile_default/ | ||
| ipython_config.py | ||
| # VSCode | ||
| .vscode/ | ||
| # pyenv | ||
| .python-version | ||
| # pipenv | ||
| # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
| # However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
| # having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
| # install all needed dependencies. | ||
| #Pipfile.lock | ||
| # PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
| __pypackages__/ | ||
| # Celery stuff | ||
| celerybeat-schedule | ||
| celerybeat.pid | ||
| # SageMath parsed files | ||
| *.sage.py | ||
| # Environments | ||
| .env | ||
| .venv | ||
| env/ | ||
| venv/ | ||
| ENV/ | ||
| env.bak/ | ||
| venv.bak/ | ||
| # Spyder project settings | ||
| .spyderproject | ||
| .spyproject | ||
| # Rope project settings | ||
| .ropeproject | ||
| # mkdocs documentation | ||
| /site | ||
| # mypy | ||
| .mypy_cache/ | ||
| .dmypy.json | ||
| dmypy.json | ||
| # Pyre type checker | ||
| .pyre/ |
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.4.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| - id: check-added-large-files | ||
| - repo: https://github.com/psf/black | ||
| rev: 23.9.1 | ||
| hooks: | ||
| - id: black | ||
| files: ^mapca/ | ||
| - repo: https://github.com/pycqa/isort | ||
| rev: 5.12.0 | ||
| hooks: | ||
| - id: isort | ||
| files: ^mapca/ |
| # .readthedocs.yml | ||
| # Read the Docs configuration file | ||
| # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
| # Required | ||
| version: 2 | ||
| # Build documentation in the docs/ directory with Sphinx | ||
| sphinx: | ||
| configuration: docs/conf.py | ||
| python: | ||
| version: 3.7 | ||
| install: | ||
| - method: pip | ||
| path: . | ||
| extra_requirements: | ||
| - doc | ||
| system_packages: true |
+28
| { | ||
| "creators": [ | ||
| { | ||
| "name": "The ME-ICA Community" | ||
| }, | ||
| { | ||
| "name": "Ahmed, Zaki", | ||
| "affiliation": "Mayo Clinic", | ||
| "orcid": "0000-0001-5648-0590" | ||
| }, | ||
| { | ||
| "name": "Salo, Taylor", | ||
| "affiliation": "Florida International University", | ||
| "orcid": "0000-0001-9813-3167" | ||
| }, | ||
| { | ||
| "name": "Uruñuela, Eneko", | ||
| "affiliation": "Basque Center on Cognition, Brain and Language", | ||
| "orcid": "0000-0001-6849-9088" | ||
| } | ||
| ], | ||
| "keywords": [ | ||
| "neuroimaging", | ||
| "fMRI" | ||
| ], | ||
| "license": "GPL-2.0", | ||
| "upload_type": "software" | ||
| } |
| # Code of Conduct | ||
| In the interest of fostering an open and welcoming environment we want | ||
| participation in our project and our community to be a harassment-free | ||
| experience for everyone. | ||
| Although no list can hope to be all-encompassing, we explicitly honor diversity in age, | ||
| body size, disability, ethnicity, gender identity and expression, level of experience, native language, education, socio-economic status, nationality, personal appearance, race, religion, | ||
| or sexual identity and orientation. | ||
| ## Our Standards | ||
| We aim to promote behavior that contributes to a positive and welcoming environment. | ||
| Examples of such behavior include: | ||
| * Using inclusive language | ||
| * Being respectful of differing viewpoints and experiences | ||
| * Showing empathy towards other community members | ||
| We do not tolerate harassment or other, inappropriate behavior in our community. | ||
| Examples of unacceptable behavior by participants include: | ||
| * The use of sexualized language or imagery and unwelcome sexual attention or | ||
| advances | ||
| * Personal or political attacks on contributors, and insulting or derogatory | ||
| comments on contributed code with the intent to undermine contributions | ||
| * Public or private harassment | ||
| ## Our Responsibilities | ||
| The maintainers are responsible for clarifying the standards | ||
| of acceptable behavior and are expected to take appropriate and fair corrective | ||
| action in response to any instances of unacceptable behavior. | ||
| The maintainers have the right and responsibility to remove, | ||
| edit, or reject comments, commits, code, issues, and other contributions | ||
| that are not aligned to this Code of Conduct, or to ban temporarily or | ||
| permanently any contributor for other behaviors that they deem inappropriate, | ||
| threatening, offensive, or harmful. | ||
| ## Scope | ||
| This Code of Conduct applies both within our online GitHub repository | ||
| and in public spaces when an individual is representing the project or its community. | ||
| Examples of representing a project or community include using an official project e-mail | ||
| address, posting via an official social media account, or acting as an appointed | ||
| representative at an online or offline event. | ||
| ## Enforcement | ||
| Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
| reported by contacting Eneko Urunuela at <e.urunuela@bcbl.eu>. | ||
| Confidentiality will be respected in reporting. | ||
| The enforcement officer can take any action they deem appropriate | ||
| for the safety of the `mapca` community, including but not limited to: | ||
| * facilitating a conversation between the two parties involved in the violation of the code of conduct | ||
| * requesting a contributor apologize for their behaviour | ||
| * asking a contributor or multiple contributors to enter a cooling off period that puts a | ||
| time-limited pause on a particular discussion topic | ||
| * asking a contributor to no longer participate in the development of `mapca` | ||
| ## Attribution | ||
| This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, | ||
| available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html | ||
| [homepage]: https://www.contributor-covenant.org |
+339
| GNU GENERAL PUBLIC LICENSE | ||
| Version 2, June 1991 | ||
| Copyright (C) 1989, 1991 Free Software Foundation, Inc., | ||
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| Everyone is permitted to copy and distribute verbatim copies | ||
| of this license document, but changing it is not allowed. | ||
| Preamble | ||
| The licenses for most software are designed to take away your | ||
| freedom to share and change it. By contrast, the GNU General Public | ||
| License is intended to guarantee your freedom to share and change free | ||
| software--to make sure the software is free for all its users. This | ||
| General Public License applies to most of the Free Software | ||
| Foundation's software and to any other program whose authors commit to | ||
| using it. (Some other Free Software Foundation software is covered by | ||
| the GNU Lesser General Public License instead.) You can apply it to | ||
| your programs, too. | ||
| When we speak of free software, we are referring to freedom, not | ||
| price. Our General Public Licenses are designed to make sure that you | ||
| have the freedom to distribute copies of free software (and charge for | ||
| this service if you wish), that you receive source code or can get it | ||
| if you want it, that you can change the software or use pieces of it | ||
| in new free programs; and that you know you can do these things. | ||
| To protect your rights, we need to make restrictions that forbid | ||
| anyone to deny you these rights or to ask you to surrender the rights. | ||
| These restrictions translate to certain responsibilities for you if you | ||
| distribute copies of the software, or if you modify it. | ||
| For example, if you distribute copies of such a program, whether | ||
| gratis or for a fee, you must give the recipients all the rights that | ||
| you have. You must make sure that they, too, receive or can get the | ||
| source code. And you must show them these terms so they know their | ||
| rights. | ||
| We protect your rights with two steps: (1) copyright the software, and | ||
| (2) offer you this license which gives you legal permission to copy, | ||
| distribute and/or modify the software. | ||
| Also, for each author's protection and ours, we want to make certain | ||
| that everyone understands that there is no warranty for this free | ||
| software. If the software is modified by someone else and passed on, we | ||
| want its recipients to know that what they have is not the original, so | ||
| that any problems introduced by others will not reflect on the original | ||
| authors' reputations. | ||
| Finally, any free program is threatened constantly by software | ||
| patents. We wish to avoid the danger that redistributors of a free | ||
| program will individually obtain patent licenses, in effect making the | ||
| program proprietary. To prevent this, we have made it clear that any | ||
| patent must be licensed for everyone's free use or not licensed at all. | ||
| The precise terms and conditions for copying, distribution and | ||
| modification follow. | ||
| GNU GENERAL PUBLIC LICENSE | ||
| TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | ||
| 0. This License applies to any program or other work which contains | ||
| a notice placed by the copyright holder saying it may be distributed | ||
| under the terms of this General Public License. The "Program", below, | ||
| refers to any such program or work, and a "work based on the Program" | ||
| means either the Program or any derivative work under copyright law: | ||
| that is to say, a work containing the Program or a portion of it, | ||
| either verbatim or with modifications and/or translated into another | ||
| language. (Hereinafter, translation is included without limitation in | ||
| the term "modification".) Each licensee is addressed as "you". | ||
| Activities other than copying, distribution and modification are not | ||
| covered by this License; they are outside its scope. The act of | ||
| running the Program is not restricted, and the output from the Program | ||
| is covered only if its contents constitute a work based on the | ||
| Program (independent of having been made by running the Program). | ||
| Whether that is true depends on what the Program does. | ||
| 1. You may copy and distribute verbatim copies of the Program's | ||
| source code as you receive it, in any medium, provided that you | ||
| conspicuously and appropriately publish on each copy an appropriate | ||
| copyright notice and disclaimer of warranty; keep intact all the | ||
| notices that refer to this License and to the absence of any warranty; | ||
| and give any other recipients of the Program a copy of this License | ||
| along with the Program. | ||
| You may charge a fee for the physical act of transferring a copy, and | ||
| you may at your option offer warranty protection in exchange for a fee. | ||
| 2. You may modify your copy or copies of the Program or any portion | ||
| of it, thus forming a work based on the Program, and copy and | ||
| distribute such modifications or work under the terms of Section 1 | ||
| above, provided that you also meet all of these conditions: | ||
| a) You must cause the modified files to carry prominent notices | ||
| stating that you changed the files and the date of any change. | ||
| b) You must cause any work that you distribute or publish, that in | ||
| whole or in part contains or is derived from the Program or any | ||
| part thereof, to be licensed as a whole at no charge to all third | ||
| parties under the terms of this License. | ||
| c) If the modified program normally reads commands interactively | ||
| when run, you must cause it, when started running for such | ||
| interactive use in the most ordinary way, to print or display an | ||
| announcement including an appropriate copyright notice and a | ||
| notice that there is no warranty (or else, saying that you provide | ||
| a warranty) and that users may redistribute the program under | ||
| these conditions, and telling the user how to view a copy of this | ||
| License. (Exception: if the Program itself is interactive but | ||
| does not normally print such an announcement, your work based on | ||
| the Program is not required to print an announcement.) | ||
| These requirements apply to the modified work as a whole. If | ||
| identifiable sections of that work are not derived from the Program, | ||
| and can be reasonably considered independent and separate works in | ||
| themselves, then this License, and its terms, do not apply to those | ||
| sections when you distribute them as separate works. But when you | ||
| distribute the same sections as part of a whole which is a work based | ||
| on the Program, the distribution of the whole must be on the terms of | ||
| this License, whose permissions for other licensees extend to the | ||
| entire whole, and thus to each and every part regardless of who wrote it. | ||
| Thus, it is not the intent of this section to claim rights or contest | ||
| your rights to work written entirely by you; rather, the intent is to | ||
| exercise the right to control the distribution of derivative or | ||
| collective works based on the Program. | ||
| In addition, mere aggregation of another work not based on the Program | ||
| with the Program (or with a work based on the Program) on a volume of | ||
| a storage or distribution medium does not bring the other work under | ||
| the scope of this License. | ||
| 3. You may copy and distribute the Program (or a work based on it, | ||
| under Section 2) in object code or executable form under the terms of | ||
| Sections 1 and 2 above provided that you also do one of the following: | ||
| a) Accompany it with the complete corresponding machine-readable | ||
| source code, which must be distributed under the terms of Sections | ||
| 1 and 2 above on a medium customarily used for software interchange; or, | ||
| b) Accompany it with a written offer, valid for at least three | ||
| years, to give any third party, for a charge no more than your | ||
| cost of physically performing source distribution, a complete | ||
| machine-readable copy of the corresponding source code, to be | ||
| distributed under the terms of Sections 1 and 2 above on a medium | ||
| customarily used for software interchange; or, | ||
| c) Accompany it with the information you received as to the offer | ||
| to distribute corresponding source code. (This alternative is | ||
| allowed only for noncommercial distribution and only if you | ||
| received the program in object code or executable form with such | ||
| an offer, in accord with Subsection b above.) | ||
| The source code for a work means the preferred form of the work for | ||
| making modifications to it. For an executable work, complete source | ||
| code means all the source code for all modules it contains, plus any | ||
| associated interface definition files, plus the scripts used to | ||
| control compilation and installation of the executable. However, as a | ||
| special exception, the source code distributed need not include | ||
| anything that is normally distributed (in either source or binary | ||
| form) with the major components (compiler, kernel, and so on) of the | ||
| operating system on which the executable runs, unless that component | ||
| itself accompanies the executable. | ||
| If distribution of executable or object code is made by offering | ||
| access to copy from a designated place, then offering equivalent | ||
| access to copy the source code from the same place counts as | ||
| distribution of the source code, even though third parties are not | ||
| compelled to copy the source along with the object code. | ||
| 4. You may not copy, modify, sublicense, or distribute the Program | ||
| except as expressly provided under this License. Any attempt | ||
| otherwise to copy, modify, sublicense or distribute the Program is | ||
| void, and will automatically terminate your rights under this License. | ||
| However, parties who have received copies, or rights, from you under | ||
| this License will not have their licenses terminated so long as such | ||
| parties remain in full compliance. | ||
| 5. You are not required to accept this License, since you have not | ||
| signed it. However, nothing else grants you permission to modify or | ||
| distribute the Program or its derivative works. These actions are | ||
| prohibited by law if you do not accept this License. Therefore, by | ||
| modifying or distributing the Program (or any work based on the | ||
| Program), you indicate your acceptance of this License to do so, and | ||
| all its terms and conditions for copying, distributing or modifying | ||
| the Program or works based on it. | ||
| 6. Each time you redistribute the Program (or any work based on the | ||
| Program), the recipient automatically receives a license from the | ||
| original licensor to copy, distribute or modify the Program subject to | ||
| these terms and conditions. You may not impose any further | ||
| restrictions on the recipients' exercise of the rights granted herein. | ||
| You are not responsible for enforcing compliance by third parties to | ||
| this License. | ||
| 7. If, as a consequence of a court judgment or allegation of patent | ||
| infringement or for any other reason (not limited to patent issues), | ||
| conditions are imposed on you (whether by court order, agreement or | ||
| otherwise) that contradict the conditions of this License, they do not | ||
| excuse you from the conditions of this License. If you cannot | ||
| distribute so as to satisfy simultaneously your obligations under this | ||
| License and any other pertinent obligations, then as a consequence you | ||
| may not distribute the Program at all. For example, if a patent | ||
| license would not permit royalty-free redistribution of the Program by | ||
| all those who receive copies directly or indirectly through you, then | ||
| the only way you could satisfy both it and this License would be to | ||
| refrain entirely from distribution of the Program. | ||
| If any portion of this section is held invalid or unenforceable under | ||
| any particular circumstance, the balance of the section is intended to | ||
| apply and the section as a whole is intended to apply in other | ||
| circumstances. | ||
| It is not the purpose of this section to induce you to infringe any | ||
| patents or other property right claims or to contest validity of any | ||
| such claims; this section has the sole purpose of protecting the | ||
| integrity of the free software distribution system, which is | ||
| implemented by public license practices. Many people have made | ||
| generous contributions to the wide range of software distributed | ||
| through that system in reliance on consistent application of that | ||
| system; it is up to the author/donor to decide if he or she is willing | ||
| to distribute software through any other system and a licensee cannot | ||
| impose that choice. | ||
| This section is intended to make thoroughly clear what is believed to | ||
| be a consequence of the rest of this License. | ||
| 8. If the distribution and/or use of the Program is restricted in | ||
| certain countries either by patents or by copyrighted interfaces, the | ||
| original copyright holder who places the Program under this License | ||
| may add an explicit geographical distribution limitation excluding | ||
| those countries, so that distribution is permitted only in or among | ||
| countries not thus excluded. In such case, this License incorporates | ||
| the limitation as if written in the body of this License. | ||
| 9. The Free Software Foundation may publish revised and/or new versions | ||
| of the General Public License from time to time. Such new versions will | ||
| be similar in spirit to the present version, but may differ in detail to | ||
| address new problems or concerns. | ||
| Each version is given a distinguishing version number. If the Program | ||
| specifies a version number of this License which applies to it and "any | ||
| later version", you have the option of following the terms and conditions | ||
| either of that version or of any later version published by the Free | ||
| Software Foundation. If the Program does not specify a version number of | ||
| this License, you may choose any version ever published by the Free Software | ||
| Foundation. | ||
| 10. If you wish to incorporate parts of the Program into other free | ||
| programs whose distribution conditions are different, write to the author | ||
| to ask for permission. For software which is copyrighted by the Free | ||
| Software Foundation, write to the Free Software Foundation; we sometimes | ||
| make exceptions for this. Our decision will be guided by the two goals | ||
| of preserving the free status of all derivatives of our free software and | ||
| of promoting the sharing and reuse of software generally. | ||
| NO WARRANTY | ||
| 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | ||
| FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | ||
| OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | ||
| PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | ||
| OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
| MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | ||
| TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | ||
| PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | ||
| REPAIR OR CORRECTION. | ||
| 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | ||
| WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | ||
| REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | ||
| INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | ||
| OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | ||
| TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | ||
| YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | ||
| PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | ||
| POSSIBILITY OF SUCH DAMAGES. | ||
| END OF TERMS AND CONDITIONS | ||
| How to Apply These Terms to Your New Programs | ||
| If you develop a new program, and you want it to be of the greatest | ||
| possible use to the public, the best way to achieve this is to make it | ||
| free software which everyone can redistribute and change under these terms. | ||
| To do so, attach the following notices to the program. It is safest | ||
| to attach them to the start of each source file to most effectively | ||
| convey the exclusion of warranty; and each file should have at least | ||
| the "copyright" line and a pointer to where the full notice is found. | ||
| <one line to give the program's name and a brief idea of what it does.> | ||
| Copyright (C) <year> <name of author> | ||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation; either version 2 of the License, or | ||
| (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
| You should have received a copy of the GNU General Public License along | ||
| with this program; if not, write to the Free Software Foundation, Inc., | ||
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| Also add information on how to contact you by electronic and paper mail. | ||
| If the program is interactive, make it output a short notice like this | ||
| when it starts in an interactive mode: | ||
| Gnomovision version 69, Copyright (C) year name of author | ||
| Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | ||
| This is free software, and you are welcome to redistribute it | ||
| under certain conditions; type `show c' for details. | ||
| The hypothetical commands `show w' and `show c' should show the appropriate | ||
| parts of the General Public License. Of course, the commands you use may | ||
| be called something other than `show w' and `show c'; they could even be | ||
| mouse-clicks or menu items--whatever suits your program. | ||
| You should also get your employer (if you work as a programmer) or your | ||
| school, if any, to sign a "copyright disclaimer" for the program, if | ||
| necessary. Here is a sample; alter the names: | ||
| Yoyodyne, Inc., hereby disclaims all copyright interest in the program | ||
| `Gnomovision' (which makes passes at compilers) written by James Hacker. | ||
| <signature of Ty Coon>, 1 April 1989 | ||
| Ty Coon, President of Vice | ||
| This General Public License does not permit incorporating your program into | ||
| proprietary programs. If your program is a subroutine library, you may | ||
| consider it more useful to permit linking proprietary applications with the | ||
| library. If this is what you want to do, use the GNU Lesser General | ||
| Public License instead of this License. |
| # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- | ||
| # vi: set ft=python sts=4 ts=4 sw=4 et: | ||
| """Base module variables.""" | ||
| try: | ||
| from mapca._version import __version__ | ||
| except ImportError: | ||
| __version__ = "0+unknown" | ||
| __packagename__ = "mapca" | ||
| __copyright__ = "Copyright 2023, The ME-ICA Developers" | ||
| __credits__ = ( | ||
| "Contributors: please check the ``.zenodo.json`` file at the top-level folder" | ||
| "of the repository" | ||
| ) | ||
| __url__ = "https://github.com/ME-ICA/mapca" | ||
| DOWNLOAD_URL = f"https://github.com/ME-ICA/{__packagename__}/archive/{__version__}.tar.gz" |
@@ -6,9 +6,7 @@ """ | ||
| from ._version import get_versions | ||
| from .due import Doi, due | ||
| from .mapca import MovingAveragePCA, ma_pca | ||
| import warnings | ||
| __version__ = get_versions()["version"] | ||
| from mapca.__about__ import __version__ | ||
| import warnings | ||
| from .mapca import MovingAveragePCA, ma_pca | ||
@@ -23,3 +21,1 @@ # cmp is not used, so ignore nipype-generated warnings | ||
| ] | ||
| del get_versions |
+14
-19
@@ -0,21 +1,16 @@ | ||
| # file generated by setuptools_scm | ||
| # don't change, don't track in version control | ||
| TYPE_CHECKING = False | ||
| if TYPE_CHECKING: | ||
| from typing import Tuple, Union | ||
| VERSION_TUPLE = Tuple[Union[int, str], ...] | ||
| else: | ||
| VERSION_TUPLE = object | ||
| # This file was generated by 'versioneer.py' (0.18) from | ||
| # revision-control system data, or from the parent directory name of an | ||
| # unpacked source archive. Distribution tarballs contain a pre-generated copy | ||
| # of this file. | ||
| version: str | ||
| __version__: str | ||
| __version_tuple__: VERSION_TUPLE | ||
| version_tuple: VERSION_TUPLE | ||
| import json | ||
| version_json = ''' | ||
| { | ||
| "date": "2022-03-16T19:11:46+0100", | ||
| "dirty": false, | ||
| "error": null, | ||
| "full-revisionid": "90ca567230dce39681ed5b826b438dd8391dbd8e", | ||
| "version": "0.0.3" | ||
| } | ||
| ''' # END VERSION_JSON | ||
| def get_versions(): | ||
| return json.loads(version_json) | ||
| __version__ = version = '0.0.4' | ||
| __version_tuple__ = version_tuple = (0, 0, 4) |
+85
-8
@@ -131,3 +131,3 @@ """PCA based on Moving Average (stationary Gaussian) process. | ||
| def _fit(self, img, mask): | ||
| def _fit(self, img, mask, subsample_depth=None): | ||
| LGR.info( | ||
@@ -213,4 +213,45 @@ "Performing dimensionality reduction based on GIFT " | ||
| sub_iid_sp_median = int(np.round(np.median(sub_iid_sp))) | ||
| # Will log the mean value to check if the differences in median within a dataset | ||
| # represent very small changes in the mean. It seems like this is the closest | ||
| # to a non-discrete value to store to compare across runs. | ||
| sub_iid_sp_mean = np.round(np.mean(sub_iid_sp), 3) | ||
| if np.floor(np.power(n_samples / n_timepoints, 1 / dim_n)) < sub_iid_sp_median: | ||
| LGR.info( | ||
| "Subsampling IID depth estimate too high. Subsampling depth will " | ||
| "be defined by number of datapoints rather than IID estimates." | ||
| ) | ||
| sub_iid_sp_median = int(np.floor(np.power(n_samples / n_timepoints, 1 / dim_n))) | ||
| LGR.info("Estimated subsampling depth for effective i.i.d samples: %d" % sub_iid_sp_median) | ||
| # Always save the calculated IID subsample value, but, if there is a user provide value, | ||
| # assign that to sub_iid_sp_median and use that instead | ||
| calculated_sub_iid_sp_median = sub_iid_sp_median | ||
| if subsample_depth: | ||
| if ( | ||
| ( | ||
| isinstance(subsample_depth, int) | ||
| or ( | ||
| isinstance(subsample_depth, float) | ||
| and subsample_depth == int(subsample_depth) | ||
| ) | ||
| ) | ||
| and (1 <= subsample_depth) | ||
| and ((n_samples / (subsample_depth**3)) >= 100) | ||
| ): | ||
| sub_iid_sp_median = subsample_depth | ||
| else: | ||
| # The logic of the upper bound is subsample_depth^3 is the fraction of samples | ||
| # that removed and it would be good to have at least 100 sampling remaining to | ||
| # have a useful analysis. Given a masked volume is going to result in fewer | ||
| # samples remaining in 3D space, this is likely a very liberal upper bound, but | ||
| # probably good to at least include an upper bound. | ||
| raise ValueError( | ||
| "subsample_depth must be an integer > 1 and will retain >100 " | ||
| "samples after subsampling. It is %d" % subsample_depth | ||
| ) | ||
| N = np.round(n_samples / np.power(sub_iid_sp_median, dim_n)) | ||
@@ -241,3 +282,3 @@ | ||
| LGR.info("Effective number of i.i.d. samples %d" % N) | ||
| LGR.info("Effective number of i.i.d. samples %d from %d total voxels" % (N, n_samples)) | ||
@@ -350,2 +391,10 @@ # Make eigen spectrum adjustment | ||
| } | ||
| self.subsampling_ = { | ||
| "calculated_IID_subsample_depth": calculated_sub_iid_sp_median, | ||
| "calculated_IID_subsample_mean": sub_iid_sp_mean, | ||
| "IID_subsample_input": sub_iid_sp, | ||
| "used_IID_subsample_depth": sub_iid_sp_median, | ||
| "effective_num_IID_samples": N, | ||
| "total_num_samples": n_samples, | ||
| } | ||
@@ -372,3 +421,3 @@ # Assign attributes from model | ||
| def fit(self, img, mask): | ||
| def fit(self, img, mask, subsample_depth=None): | ||
| """Fit the model with X. | ||
@@ -382,2 +431,10 @@ | ||
| Mask to apply on ``img``. | ||
| subsample_depth : int, optional | ||
| Dimensionality reduction is calculated on a subset of voxels defined by | ||
| this depth. 2 would mean using every other voxel in 3D space and 3 would | ||
| mean every 3rd voxel. Default=None (estimated depth to make remaining | ||
| voxels independent and identically distributed (IID) | ||
| The subsampling value so that the voxels are assumed to be | ||
| independent and identically distributed (IID). | ||
| Default=None (use estimated value) | ||
@@ -389,6 +446,6 @@ Returns | ||
| """ | ||
| self._fit(img, mask) | ||
| self._fit(img, mask, subsample_depth=subsample_depth) | ||
| return self | ||
| def fit_transform(self, img, mask): | ||
| def fit_transform(self, img, mask, subsample_depth=None): | ||
| """Fit the model with X and apply the dimensionality reduction on X. | ||
@@ -402,2 +459,7 @@ | ||
| Mask to apply on ``img``. | ||
| subsample_depth : int, optional | ||
| Dimensionality reduction is calculated on a subset of voxels defined by | ||
| this depth. 2 would mean using every other voxel in 3D space and 3 would | ||
| mean every 3rd voxel. Default=None (estimated depth to make remaining | ||
| voxels independent and identically distributed (IID) | ||
@@ -413,4 +475,14 @@ Returns | ||
| which ignores explained variance. | ||
| subsample_depth is always calculated automatically, but it should be consistent | ||
| across a dataset with the same acquisition parameters, since spatial dependence | ||
| should be similar. In practice, it sometimes gives a different value and causes | ||
| problems. That is, for a dataset with 100 runs, it is 2 in most runs, but when | ||
| it is 3, substantially fewer components are estimated and when it is 1, there is | ||
| almost no dimensionality reduction. This has been added as an optional user provided | ||
| parameter. If mapca seems to be having periodic mis-estimates, then this parameter | ||
| should make it possible to set the IID subsample depth to be consistent across a | ||
| dataset. | ||
| """ | ||
| self._fit(img, mask) | ||
| self._fit(img, mask, subsample_depth=subsample_depth) | ||
| return self.transform(img) | ||
@@ -483,3 +555,3 @@ | ||
| def ma_pca(img, mask, criterion="mdl", normalize=False): | ||
| def ma_pca(img, mask, criterion="mdl", normalize=False, subsample_depth=None): | ||
| """Perform moving average-based PCA on imaging data. | ||
@@ -506,2 +578,7 @@ | ||
| Whether to normalize (zero mean and unit standard deviation) or not. Default is False. | ||
| subsample_depth : int, optional | ||
| Dimensionality reduction is calculated on a subset of voxels defined by | ||
| this depth. 2 would mean using every other voxel in 3D space and 3 would | ||
| mean every 3rd voxel. Default=None (estimated depth to make remaining | ||
| voxels independent and identically distributed (IID) | ||
@@ -520,3 +597,3 @@ Returns | ||
| pca = MovingAveragePCA(criterion=criterion, normalize=normalize) | ||
| _ = pca.fit_transform(img, mask) | ||
| _ = pca.fit_transform(img, mask, subsample_depth=subsample_depth) | ||
| u = pca.u_ | ||
@@ -523,0 +600,0 @@ s = pca.explained_variance_ |
@@ -28,3 +28,3 @@ import os | ||
| """ | ||
| url = 'https://osf.io/{}/download'.format(osf_id) | ||
| url = "https://osf.io/{}/download".format(osf_id) | ||
| full_path = os.path.join(path, filename) | ||
@@ -36,5 +36,5 @@ if not os.path.isfile(full_path): | ||
| @pytest.fixture(scope='session') | ||
| @pytest.fixture(scope="session") | ||
| def testpath(tmp_path_factory): | ||
| """ Test path that will be used to download all files """ | ||
| """Test path that will be used to download all files""" | ||
| return tmp_path_factory.getbasetemp() | ||
@@ -45,4 +45,3 @@ | ||
| def test_img(testpath): | ||
| return fetch_file('jw43h', testpath, | ||
| 'data.nii.gz') | ||
| return fetch_file("jw43h", testpath, "data.nii.gz") | ||
@@ -52,4 +51,3 @@ | ||
| def test_mask(testpath): | ||
| return fetch_file('9u2m5', testpath, | ||
| 'mask.nii.gz') | ||
| return fetch_file("9u2m5", testpath, "mask.nii.gz") | ||
@@ -59,4 +57,3 @@ | ||
| def test_ts(testpath): | ||
| return fetch_file('gz2hb', testpath, | ||
| 'compt_ts.npy') | ||
| return fetch_file("gz2hb", testpath, "comp_ts.npy") | ||
@@ -66,4 +63,3 @@ | ||
| def test_varex(testpath): | ||
| return fetch_file('7xj5k', testpath, | ||
| 'varex.npy') | ||
| return fetch_file("7xj5k", testpath, "varex.npy") | ||
@@ -73,4 +69,3 @@ | ||
| def test_varex_norm(testpath): | ||
| return fetch_file('jrd9c', testpath, | ||
| 'varex_norm.npy') | ||
| return fetch_file("jrd9c", testpath, "varex_norm.npy") | ||
@@ -80,3 +75,2 @@ | ||
| def test_weights(testpath): | ||
| return fetch_file('t94m8', testpath, | ||
| 'voxel_comp_weights.npy') | ||
| return fetch_file("t94m8", testpath, "voxel_comp_weights.npy") |
| """ | ||
| Integration test for mapca. | ||
| """ | ||
| import nibabel as nib | ||
| import numpy as np | ||
| import shutil | ||
| from os.path import split | ||
| import nibabel as nib | ||
| import numpy as np | ||
| from mapca.mapca import ma_pca | ||
| def test_integration(test_img, test_mask, test_ts, test_varex, | ||
| test_varex_norm, test_weights): | ||
| def test_integration(test_img, test_mask, test_ts, test_varex, test_varex_norm, test_weights): | ||
| """Integration test for mapca.""" | ||
| test_path, _ = split(test_img) | ||
@@ -16,0 +16,0 @@ |
@@ -9,3 +9,3 @@ """ | ||
| from mapca.mapca import ma_pca, MovingAveragePCA | ||
| from mapca.mapca import MovingAveragePCA, ma_pca | ||
@@ -18,3 +18,3 @@ | ||
| n_voxels = 20 | ||
| n_vox_total = n_voxels ** 3 | ||
| n_vox_total = n_voxels**3 | ||
@@ -79,3 +79,3 @@ # Creates fake data to test with | ||
| test_mask[5:-5, 5:-5, 5:-5] = 1 | ||
| test_mask_img = nib.nifti1.Nifti1Image(test_mask, xform) | ||
| test_mask_img = nib.nifti1.Nifti1Image(test_mask, xform, dtype=np.int16) | ||
| n_voxels_in_mask = np.sum(test_mask) | ||
@@ -101,1 +101,7 @@ | ||
| assert test_data_est.shape == test_img.shape | ||
| # Testing setting inputting a pre-defined subsampling depth | ||
| pca3 = MovingAveragePCA(criterion="mdl", normalize=False) | ||
| pca3.fit(test_img, test_mask_img, subsample_depth=2) | ||
| assert pca3.subsampling_["calculated_IID_subsample_depth"] == 1 | ||
| assert pca3.subsampling_["used_IID_subsample_depth"] == 2 |
| """Unit tests for utils.""" | ||
| import numpy as np | ||
| from scipy.signal.windows import parzen | ||
| from pytest import raises | ||
| from scipy.signal import detrend | ||
| from scipy.signal.windows import parzen | ||
| from scipy.stats import kurtosis | ||
| from mapca.utils import (_autocorr, _eigensp_adj, _icatb_svd, | ||
| _subsampling, ent_rate_sp) | ||
| from mapca.utils import _autocorr, _eigensp_adj, _icatb_svd, _subsampling, ent_rate_sp | ||
@@ -110,3 +109,3 @@ | ||
| for i in range(test_data.shape[1]): | ||
| data_norm = detrend(test_data[:, i], type='constant') | ||
| data_norm = detrend(test_data[:, i], type="constant") | ||
| data_norm /= np.std(data_norm) | ||
@@ -113,0 +112,0 @@ kurt_gift[i] = np.mean(data_norm**4) - 3 |
+383
-30
| Metadata-Version: 2.1 | ||
| Name: mapca | ||
| Version: 0.0.3 | ||
| Summary: A Python implementation of the moving average principal components analysis methods from GIFT. | ||
| Home-page: https://github.com/me-ica/mapca | ||
| Version: 0.0.4 | ||
| Summary: Moving Average Principal Component Analysis for fMRI data | ||
| Project-URL: Homepage, https://github.com/ME-ICA/mapca | ||
| Project-URL: Documentation, https://www.mapca.readthedocs.io | ||
| Author: mapca developers | ||
| Author-email: e.urunuela@bcbl.eu | ||
| Maintainer: Eneko Urunuela | ||
| Maintainer-email: e.urunuela@bcbl.eu | ||
| License: GPL-2.0 | ||
| Download-URL: https://github.com/ME-ICA/mapca/archive/0.0.3.tar.gz | ||
| Description: # mapca | ||
| A Python implementation of the moving average principal components analysis methods from GIFT | ||
| License: GNU GENERAL PUBLIC LICENSE | ||
| Version 2, June 1991 | ||
| [](https://pypi.python.org/pypi/mapca/) | ||
| [](https://pypi.python.org/pypi/mapca/) | ||
| [](https://opensource.org/licenses/GPL-2.0) | ||
| [](https://circleci.com/gh/ME-ICA/mapca) | ||
| [](https://codecov.io/gh/ME-ICA/mapca) | ||
| [](http://isitmaintained.com/project/ME-ICA/mapca "Average time to resolve an issue") | ||
| [](http://isitmaintained.com/project/ME-ICA/mapca "Percentage of issues still open") | ||
| [](https://gitter.im/ME-ICA/mapca?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
| Copyright (C) 1989, 1991 Free Software Foundation, Inc., | ||
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| Everyone is permitted to copy and distribute verbatim copies | ||
| of this license document, but changing it is not allowed. | ||
| ## About | ||
| Preamble | ||
| `mapca` is a Python package that performs dimensionality reduction with principal component analysis (PCA) on functional magnetic resonance imaging (fMRI) data. It is a translation to Python of the dimensionality reduction technique used in the MATLAB-based [GIFT package](https://trendscenter.org/software/gift/) and introduced by Li et al. 2007[^1]. | ||
| The licenses for most software are designed to take away your | ||
| freedom to share and change it. By contrast, the GNU General Public | ||
| License is intended to guarantee your freedom to share and change free | ||
| software--to make sure the software is free for all its users. This | ||
| General Public License applies to most of the Free Software | ||
| Foundation's software and to any other program whose authors commit to | ||
| using it. (Some other Free Software Foundation software is covered by | ||
| the GNU Lesser General Public License instead.) You can apply it to | ||
| your programs, too. | ||
| [^1]: Li, Y. O., Adali, T., & Calhoun, V. D. (2007). Estimating the number of independent components for functional magnetic resonance imaging data. Human Brain Mapping, 28(11), 1251–1266. https://doi.org/10.1002/hbm.20359 | ||
| When we speak of free software, we are referring to freedom, not | ||
| price. Our General Public Licenses are designed to make sure that you | ||
| have the freedom to distribute copies of free software (and charge for | ||
| this service if you wish), that you receive source code or can get it | ||
| if you want it, that you can change the software or use pieces of it | ||
| in new free programs; and that you know you can do these things. | ||
| Platform: UNKNOWN | ||
| To protect your rights, we need to make restrictions that forbid | ||
| anyone to deny you these rights or to ask you to surrender the rights. | ||
| These restrictions translate to certain responsibilities for you if you | ||
| distribute copies of the software, or if you modify it. | ||
| For example, if you distribute copies of such a program, whether | ||
| gratis or for a fee, you must give the recipients all the rights that | ||
| you have. You must make sure that they, too, receive or can get the | ||
| source code. And you must show them these terms so they know their | ||
| rights. | ||
| We protect your rights with two steps: (1) copyright the software, and | ||
| (2) offer you this license which gives you legal permission to copy, | ||
| distribute and/or modify the software. | ||
| Also, for each author's protection and ours, we want to make certain | ||
| that everyone understands that there is no warranty for this free | ||
| software. If the software is modified by someone else and passed on, we | ||
| want its recipients to know that what they have is not the original, so | ||
| that any problems introduced by others will not reflect on the original | ||
| authors' reputations. | ||
| Finally, any free program is threatened constantly by software | ||
| patents. We wish to avoid the danger that redistributors of a free | ||
| program will individually obtain patent licenses, in effect making the | ||
| program proprietary. To prevent this, we have made it clear that any | ||
| patent must be licensed for everyone's free use or not licensed at all. | ||
| The precise terms and conditions for copying, distribution and | ||
| modification follow. | ||
| GNU GENERAL PUBLIC LICENSE | ||
| TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | ||
| 0. This License applies to any program or other work which contains | ||
| a notice placed by the copyright holder saying it may be distributed | ||
| under the terms of this General Public License. The "Program", below, | ||
| refers to any such program or work, and a "work based on the Program" | ||
| means either the Program or any derivative work under copyright law: | ||
| that is to say, a work containing the Program or a portion of it, | ||
| either verbatim or with modifications and/or translated into another | ||
| language. (Hereinafter, translation is included without limitation in | ||
| the term "modification".) Each licensee is addressed as "you". | ||
| Activities other than copying, distribution and modification are not | ||
| covered by this License; they are outside its scope. The act of | ||
| running the Program is not restricted, and the output from the Program | ||
| is covered only if its contents constitute a work based on the | ||
| Program (independent of having been made by running the Program). | ||
| Whether that is true depends on what the Program does. | ||
| 1. You may copy and distribute verbatim copies of the Program's | ||
| source code as you receive it, in any medium, provided that you | ||
| conspicuously and appropriately publish on each copy an appropriate | ||
| copyright notice and disclaimer of warranty; keep intact all the | ||
| notices that refer to this License and to the absence of any warranty; | ||
| and give any other recipients of the Program a copy of this License | ||
| along with the Program. | ||
| You may charge a fee for the physical act of transferring a copy, and | ||
| you may at your option offer warranty protection in exchange for a fee. | ||
| 2. You may modify your copy or copies of the Program or any portion | ||
| of it, thus forming a work based on the Program, and copy and | ||
| distribute such modifications or work under the terms of Section 1 | ||
| above, provided that you also meet all of these conditions: | ||
| a) You must cause the modified files to carry prominent notices | ||
| stating that you changed the files and the date of any change. | ||
| b) You must cause any work that you distribute or publish, that in | ||
| whole or in part contains or is derived from the Program or any | ||
| part thereof, to be licensed as a whole at no charge to all third | ||
| parties under the terms of this License. | ||
| c) If the modified program normally reads commands interactively | ||
| when run, you must cause it, when started running for such | ||
| interactive use in the most ordinary way, to print or display an | ||
| announcement including an appropriate copyright notice and a | ||
| notice that there is no warranty (or else, saying that you provide | ||
| a warranty) and that users may redistribute the program under | ||
| these conditions, and telling the user how to view a copy of this | ||
| License. (Exception: if the Program itself is interactive but | ||
| does not normally print such an announcement, your work based on | ||
| the Program is not required to print an announcement.) | ||
| These requirements apply to the modified work as a whole. If | ||
| identifiable sections of that work are not derived from the Program, | ||
| and can be reasonably considered independent and separate works in | ||
| themselves, then this License, and its terms, do not apply to those | ||
| sections when you distribute them as separate works. But when you | ||
| distribute the same sections as part of a whole which is a work based | ||
| on the Program, the distribution of the whole must be on the terms of | ||
| this License, whose permissions for other licensees extend to the | ||
| entire whole, and thus to each and every part regardless of who wrote it. | ||
| Thus, it is not the intent of this section to claim rights or contest | ||
| your rights to work written entirely by you; rather, the intent is to | ||
| exercise the right to control the distribution of derivative or | ||
| collective works based on the Program. | ||
| In addition, mere aggregation of another work not based on the Program | ||
| with the Program (or with a work based on the Program) on a volume of | ||
| a storage or distribution medium does not bring the other work under | ||
| the scope of this License. | ||
| 3. You may copy and distribute the Program (or a work based on it, | ||
| under Section 2) in object code or executable form under the terms of | ||
| Sections 1 and 2 above provided that you also do one of the following: | ||
| a) Accompany it with the complete corresponding machine-readable | ||
| source code, which must be distributed under the terms of Sections | ||
| 1 and 2 above on a medium customarily used for software interchange; or, | ||
| b) Accompany it with a written offer, valid for at least three | ||
| years, to give any third party, for a charge no more than your | ||
| cost of physically performing source distribution, a complete | ||
| machine-readable copy of the corresponding source code, to be | ||
| distributed under the terms of Sections 1 and 2 above on a medium | ||
| customarily used for software interchange; or, | ||
| c) Accompany it with the information you received as to the offer | ||
| to distribute corresponding source code. (This alternative is | ||
| allowed only for noncommercial distribution and only if you | ||
| received the program in object code or executable form with such | ||
| an offer, in accord with Subsection b above.) | ||
| The source code for a work means the preferred form of the work for | ||
| making modifications to it. For an executable work, complete source | ||
| code means all the source code for all modules it contains, plus any | ||
| associated interface definition files, plus the scripts used to | ||
| control compilation and installation of the executable. However, as a | ||
| special exception, the source code distributed need not include | ||
| anything that is normally distributed (in either source or binary | ||
| form) with the major components (compiler, kernel, and so on) of the | ||
| operating system on which the executable runs, unless that component | ||
| itself accompanies the executable. | ||
| If distribution of executable or object code is made by offering | ||
| access to copy from a designated place, then offering equivalent | ||
| access to copy the source code from the same place counts as | ||
| distribution of the source code, even though third parties are not | ||
| compelled to copy the source along with the object code. | ||
| 4. You may not copy, modify, sublicense, or distribute the Program | ||
| except as expressly provided under this License. Any attempt | ||
| otherwise to copy, modify, sublicense or distribute the Program is | ||
| void, and will automatically terminate your rights under this License. | ||
| However, parties who have received copies, or rights, from you under | ||
| this License will not have their licenses terminated so long as such | ||
| parties remain in full compliance. | ||
| 5. You are not required to accept this License, since you have not | ||
| signed it. However, nothing else grants you permission to modify or | ||
| distribute the Program or its derivative works. These actions are | ||
| prohibited by law if you do not accept this License. Therefore, by | ||
| modifying or distributing the Program (or any work based on the | ||
| Program), you indicate your acceptance of this License to do so, and | ||
| all its terms and conditions for copying, distributing or modifying | ||
| the Program or works based on it. | ||
| 6. Each time you redistribute the Program (or any work based on the | ||
| Program), the recipient automatically receives a license from the | ||
| original licensor to copy, distribute or modify the Program subject to | ||
| these terms and conditions. You may not impose any further | ||
| restrictions on the recipients' exercise of the rights granted herein. | ||
| You are not responsible for enforcing compliance by third parties to | ||
| this License. | ||
| 7. If, as a consequence of a court judgment or allegation of patent | ||
| infringement or for any other reason (not limited to patent issues), | ||
| conditions are imposed on you (whether by court order, agreement or | ||
| otherwise) that contradict the conditions of this License, they do not | ||
| excuse you from the conditions of this License. If you cannot | ||
| distribute so as to satisfy simultaneously your obligations under this | ||
| License and any other pertinent obligations, then as a consequence you | ||
| may not distribute the Program at all. For example, if a patent | ||
| license would not permit royalty-free redistribution of the Program by | ||
| all those who receive copies directly or indirectly through you, then | ||
| the only way you could satisfy both it and this License would be to | ||
| refrain entirely from distribution of the Program. | ||
| If any portion of this section is held invalid or unenforceable under | ||
| any particular circumstance, the balance of the section is intended to | ||
| apply and the section as a whole is intended to apply in other | ||
| circumstances. | ||
| It is not the purpose of this section to induce you to infringe any | ||
| patents or other property right claims or to contest validity of any | ||
| such claims; this section has the sole purpose of protecting the | ||
| integrity of the free software distribution system, which is | ||
| implemented by public license practices. Many people have made | ||
| generous contributions to the wide range of software distributed | ||
| through that system in reliance on consistent application of that | ||
| system; it is up to the author/donor to decide if he or she is willing | ||
| to distribute software through any other system and a licensee cannot | ||
| impose that choice. | ||
| This section is intended to make thoroughly clear what is believed to | ||
| be a consequence of the rest of this License. | ||
| 8. If the distribution and/or use of the Program is restricted in | ||
| certain countries either by patents or by copyrighted interfaces, the | ||
| original copyright holder who places the Program under this License | ||
| may add an explicit geographical distribution limitation excluding | ||
| those countries, so that distribution is permitted only in or among | ||
| countries not thus excluded. In such case, this License incorporates | ||
| the limitation as if written in the body of this License. | ||
| 9. The Free Software Foundation may publish revised and/or new versions | ||
| of the General Public License from time to time. Such new versions will | ||
| be similar in spirit to the present version, but may differ in detail to | ||
| address new problems or concerns. | ||
| Each version is given a distinguishing version number. If the Program | ||
| specifies a version number of this License which applies to it and "any | ||
| later version", you have the option of following the terms and conditions | ||
| either of that version or of any later version published by the Free | ||
| Software Foundation. If the Program does not specify a version number of | ||
| this License, you may choose any version ever published by the Free Software | ||
| Foundation. | ||
| 10. If you wish to incorporate parts of the Program into other free | ||
| programs whose distribution conditions are different, write to the author | ||
| to ask for permission. For software which is copyrighted by the Free | ||
| Software Foundation, write to the Free Software Foundation; we sometimes | ||
| make exceptions for this. Our decision will be guided by the two goals | ||
| of preserving the free status of all derivatives of our free software and | ||
| of promoting the sharing and reuse of software generally. | ||
| NO WARRANTY | ||
| 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | ||
| FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | ||
| OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | ||
| PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | ||
| OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
| MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | ||
| TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | ||
| PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | ||
| REPAIR OR CORRECTION. | ||
| 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | ||
| WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | ||
| REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | ||
| INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | ||
| OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | ||
| TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | ||
| YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | ||
| PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | ||
| POSSIBILITY OF SUCH DAMAGES. | ||
| END OF TERMS AND CONDITIONS | ||
| How to Apply These Terms to Your New Programs | ||
| If you develop a new program, and you want it to be of the greatest | ||
| possible use to the public, the best way to achieve this is to make it | ||
| free software which everyone can redistribute and change under these terms. | ||
| To do so, attach the following notices to the program. It is safest | ||
| to attach them to the start of each source file to most effectively | ||
| convey the exclusion of warranty; and each file should have at least | ||
| the "copyright" line and a pointer to where the full notice is found. | ||
| <one line to give the program's name and a brief idea of what it does.> | ||
| Copyright (C) <year> <name of author> | ||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation; either version 2 of the License, or | ||
| (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
| You should have received a copy of the GNU General Public License along | ||
| with this program; if not, write to the Free Software Foundation, Inc., | ||
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| Also add information on how to contact you by electronic and paper mail. | ||
| If the program is interactive, make it output a short notice like this | ||
| when it starts in an interactive mode: | ||
| Gnomovision version 69, Copyright (C) year name of author | ||
| Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | ||
| This is free software, and you are welcome to redistribute it | ||
| under certain conditions; type `show c' for details. | ||
| The hypothetical commands `show w' and `show c' should show the appropriate | ||
| parts of the General Public License. Of course, the commands you use may | ||
| be called something other than `show w' and `show c'; they could even be | ||
| mouse-clicks or menu items--whatever suits your program. | ||
| You should also get your employer (if you work as a programmer) or your | ||
| school, if any, to sign a "copyright disclaimer" for the program, if | ||
| necessary. Here is a sample; alter the names: | ||
| Yoyodyne, Inc., hereby disclaims all copyright interest in the program | ||
| `Gnomovision' (which makes passes at compilers) written by James Hacker. | ||
| <signature of Ty Coon>, 1 April 1989 | ||
| Ty Coon, President of Vice | ||
| This General Public License does not permit incorporating your program into | ||
| proprietary programs. If your program is a subroutine library, you may | ||
| consider it more useful to permit linking proprietary applications with the | ||
| library. If this is what you want to do, use the GNU Lesser General | ||
| Public License instead of this License. | ||
| License-File: LICENSE | ||
| Classifier: Development Status :: 4 - Beta | ||
| Classifier: Intended Audience :: Science/Research | ||
| Classifier: Topic :: Scientific/Engineering :: Information Analysis | ||
| Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) | ||
| Classifier: Programming Language :: Python :: 3.5 | ||
| Classifier: Programming Language :: Python :: 3.6 | ||
| Classifier: Programming Language :: Python :: 3.7 | ||
| Classifier: Programming Language :: Python :: 3.8 | ||
| Classifier: Programming Language :: Python :: 3.9 | ||
| Requires-Python: >=3.5 | ||
| Description-Content-Type: text/markdown | ||
| Classifier: Programming Language :: Python :: 3.10 | ||
| Classifier: Topic :: Scientific/Engineering :: Information Analysis | ||
| Requires-Python: >=3.8 | ||
| Requires-Dist: nibabel>=2.5.1 | ||
| Requires-Dist: nilearn | ||
| Requires-Dist: numpy>=1.16 | ||
| Requires-Dist: scikit-learn>=1.2 | ||
| Requires-Dist: scipy>=1.3.3 | ||
| Provides-Extra: all | ||
| Requires-Dist: mapca[dev,doc,tests]; extra == 'all' | ||
| Provides-Extra: dev | ||
| Requires-Dist: pre-commit; extra == 'dev' | ||
| Provides-Extra: doc | ||
| Requires-Dist: sphinx-argparse; extra == 'doc' | ||
| Requires-Dist: sphinx-copybutton; extra == 'doc' | ||
| Requires-Dist: sphinx-rtd-theme>=1.2.2; extra == 'doc' | ||
| Requires-Dist: sphinx>=6.2.1; extra == 'doc' | ||
| Requires-Dist: sphinxcontrib-bibtex; extra == 'doc' | ||
| Provides-Extra: tests | ||
| Provides-Extra: duecredit | ||
| Provides-Extra: all | ||
| Requires-Dist: codecov; extra == 'tests' | ||
| Requires-Dist: coverage; extra == 'tests' | ||
| Requires-Dist: flake8-black; extra == 'tests' | ||
| Requires-Dist: flake8-isort; extra == 'tests' | ||
| Requires-Dist: flake8-pyproject; extra == 'tests' | ||
| Requires-Dist: flake8>=3.7; extra == 'tests' | ||
| Requires-Dist: pytest; extra == 'tests' | ||
| Requires-Dist: pytest-cov>=4.0.0; extra == 'tests' | ||
| Requires-Dist: requests; extra == 'tests' | ||
| Description-Content-Type: text/markdown | ||
| # mapca | ||
| A Python implementation of the moving average principal components analysis methods from GIFT | ||
| [](https://pypi.python.org/pypi/mapca/) | ||
| [](https://pypi.python.org/pypi/mapca/) | ||
| [](https://opensource.org/licenses/GPL-2.0) | ||
| [](https://circleci.com/gh/ME-ICA/mapca) | ||
| [](https://codecov.io/gh/ME-ICA/mapca) | ||
| [](http://isitmaintained.com/project/ME-ICA/mapca "Average time to resolve an issue") | ||
| [](http://isitmaintained.com/project/ME-ICA/mapca "Percentage of issues still open") | ||
| [](https://gitter.im/ME-ICA/mapca?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
| ## About | ||
| `mapca` is a Python package that performs dimensionality reduction with principal component analysis (PCA) on functional magnetic resonance imaging (fMRI) data. It is a translation to Python of the dimensionality reduction technique used in the MATLAB-based [GIFT package](https://trendscenter.org/software/gift/) and introduced by Li et al. 2007[^1]. | ||
| [^1]: Li, Y. O., Adali, T., & Calhoun, V. D. (2007). Estimating the number of independent components for functional magnetic resonance imaging data. Human Brain Mapping, 28(11), 1251–1266. https://doi.org/10.1002/hbm.20359 |
+121
-6
| [build-system] | ||
| requires = ["setuptools", "wheel"] | ||
| requires = ["hatchling", "hatch-vcs"] | ||
| build-backend = "hatchling.build" | ||
| [project] | ||
| name = "mapca" | ||
| description = "Moving Average Principal Component Analysis for fMRI data" | ||
| readme = "README.md" | ||
| authors = [{name = "mapca developers"}] | ||
| classifiers = [ | ||
| "Development Status :: 4 - Beta", | ||
| "Intended Audience :: Science/Research", | ||
| "Topic :: Scientific/Engineering :: Information Analysis", | ||
| "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", | ||
| "Programming Language :: Python :: 3.8", | ||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python :: 3.10", | ||
| ] | ||
| license = {file = "LICENSE"} | ||
| requires-python = ">=3.8" | ||
| dependencies = [ | ||
| "nibabel>=2.5.1", | ||
| "nilearn", | ||
| "numpy>=1.16", | ||
| "scikit-learn>=1.2", | ||
| "scipy>=1.3.3", | ||
| ] | ||
| dynamic = ["version"] | ||
| [project.urls] | ||
| Homepage = "https://github.com/ME-ICA/mapca" | ||
| Documentation = "https://www.mapca.readthedocs.io" | ||
| [project.optional-dependencies] | ||
| dev = ["pre-commit"] | ||
| doc = [ | ||
| "sphinx>=6.2.1", | ||
| "sphinx_copybutton", | ||
| "sphinx_rtd_theme>=1.2.2", | ||
| "sphinx-argparse", | ||
| "sphinxcontrib-bibtex", | ||
| ] | ||
| tests = [ | ||
| "codecov", | ||
| "coverage", | ||
| "flake8>=3.7", | ||
| "flake8-black", | ||
| "flake8-isort", | ||
| "flake8-pyproject", | ||
| "pytest", | ||
| "pytest-cov>=4.0.0", | ||
| "requests", | ||
| ] | ||
| # Aliases | ||
| all = ["mapca[dev,doc,tests]"] | ||
| # | ||
| # Hatch configurations | ||
| # | ||
| [tool.hatch.metadata] | ||
| allow-direct-references = true | ||
| [tool.hatch.build.targets.sdist] | ||
| exclude = [".git_archival.txt"] # No longer needed in sdist | ||
| [tool.hatch.build.targets.wheel] | ||
| packages = ["mapca"] | ||
| exclude = [ | ||
| "mapca/tests/data", # Large test data directory | ||
| ] | ||
| ## The following two sections configure setuptools_scm in the hatch way | ||
| [tool.hatch.version] | ||
| source = "vcs" | ||
| [tool.hatch.build.hooks.vcs] | ||
| version-file = "mapca/_version.py" | ||
| # | ||
| # Developer tool configurations | ||
| # | ||
| [tool.black] | ||
@@ -9,2 +91,3 @@ line-length = 99 | ||
| exclude = ''' | ||
| ( | ||
@@ -17,2 +100,3 @@ /( | ||
| | \.pytest_cache | ||
| | \.testing_data_cache | ||
| | _build | ||
@@ -22,8 +106,39 @@ | build | ||
| )/ | ||
| | get_version.py | ||
| | versioneer.py | ||
| | mapca/info.py | ||
| | mapca/_version.py | ||
| | mapca/due.py | ||
| ) | ||
| ''' | ||
| ''' | ||
| [tool.isort] | ||
| profile = "black" | ||
| multi_line_output = 3 | ||
| [tool.flake8] | ||
| max-line-length = 99 | ||
| exclude = [ | ||
| "*build/", | ||
| "mapca/_version.py", | ||
| ] | ||
| ignore = ["E203", "E402", "W503"] | ||
| per-file-ignores = [ | ||
| "*/__init__.py: F401", | ||
| ] | ||
| docstring-convention = "numpy" | ||
| [tool.coverage.run] | ||
| branch = true | ||
| omit = [ | ||
| "*/tests/*", | ||
| "*/__init__.py", | ||
| "*/conftest.py", | ||
| "mapca/_version.py", | ||
| ] | ||
| [tool.coverage.report] | ||
| # Regexes for lines to exclude from consideration | ||
| exclude_lines = [ | ||
| 'raise NotImplementedError', | ||
| 'warnings\.warn', | ||
| ] | ||
| [tool.pytest] | ||
| log_cli = true |
Sorry, the diff of this file is not supported yet
| Metadata-Version: 2.1 | ||
| Name: mapca | ||
| Version: 0.0.3 | ||
| Summary: A Python implementation of the moving average principal components analysis methods from GIFT. | ||
| Home-page: https://github.com/me-ica/mapca | ||
| Author: mapca developers | ||
| Author-email: e.urunuela@bcbl.eu | ||
| Maintainer: Eneko Urunuela | ||
| Maintainer-email: e.urunuela@bcbl.eu | ||
| License: GPL-2.0 | ||
| Download-URL: https://github.com/ME-ICA/mapca/archive/0.0.3.tar.gz | ||
| Description: # mapca | ||
| A Python implementation of the moving average principal components analysis methods from GIFT | ||
| [](https://pypi.python.org/pypi/mapca/) | ||
| [](https://pypi.python.org/pypi/mapca/) | ||
| [](https://opensource.org/licenses/GPL-2.0) | ||
| [](https://circleci.com/gh/ME-ICA/mapca) | ||
| [](https://codecov.io/gh/ME-ICA/mapca) | ||
| [](http://isitmaintained.com/project/ME-ICA/mapca "Average time to resolve an issue") | ||
| [](http://isitmaintained.com/project/ME-ICA/mapca "Percentage of issues still open") | ||
| [](https://gitter.im/ME-ICA/mapca?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
| ## About | ||
| `mapca` is a Python package that performs dimensionality reduction with principal component analysis (PCA) on functional magnetic resonance imaging (fMRI) data. It is a translation to Python of the dimensionality reduction technique used in the MATLAB-based [GIFT package](https://trendscenter.org/software/gift/) and introduced by Li et al. 2007[^1]. | ||
| [^1]: Li, Y. O., Adali, T., & Calhoun, V. D. (2007). Estimating the number of independent components for functional magnetic resonance imaging data. Human Brain Mapping, 28(11), 1251–1266. https://doi.org/10.1002/hbm.20359 | ||
| Platform: UNKNOWN | ||
| Classifier: Development Status :: 4 - Beta | ||
| Classifier: Intended Audience :: Science/Research | ||
| Classifier: Topic :: Scientific/Engineering :: Information Analysis | ||
| Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) | ||
| Classifier: Programming Language :: Python :: 3.5 | ||
| Classifier: Programming Language :: Python :: 3.6 | ||
| Classifier: Programming Language :: Python :: 3.7 | ||
| Classifier: Programming Language :: Python :: 3.8 | ||
| Classifier: Programming Language :: Python :: 3.9 | ||
| Requires-Python: >=3.5 | ||
| Description-Content-Type: text/markdown | ||
| Provides-Extra: dev | ||
| Provides-Extra: doc | ||
| Provides-Extra: tests | ||
| Provides-Extra: duecredit | ||
| Provides-Extra: all |
| nibabel>=2.5.1 | ||
| nilearn | ||
| numpy>=1.15 | ||
| scikit-learn>=0.22 | ||
| scipy>=1.3.3 | ||
| [all] | ||
| requests | ||
| duecredit | ||
| sphinx-argparse | ||
| sphinx_rtd_theme | ||
| pytest-cov | ||
| versioneer | ||
| pytest | ||
| flake8>=3.7 | ||
| codecov | ||
| sphinx>=1.5.3 | ||
| coverage<5.0 | ||
| [dev] | ||
| versioneer | ||
| [doc] | ||
| sphinx>=1.5.3 | ||
| sphinx_rtd_theme | ||
| sphinx-argparse | ||
| [duecredit] | ||
| duecredit | ||
| [tests] | ||
| codecov | ||
| coverage<5.0 | ||
| flake8>=3.7 | ||
| pytest | ||
| pytest-cov | ||
| requests |
| MANIFEST.in | ||
| README.md | ||
| pyproject.toml | ||
| setup.cfg | ||
| setup.py | ||
| versioneer.py | ||
| mapca/__init__.py | ||
| mapca/_version.py | ||
| mapca/due.py | ||
| mapca/info.py | ||
| mapca/mapca.py | ||
| mapca/utils.py | ||
| mapca.egg-info/PKG-INFO | ||
| mapca.egg-info/SOURCES.txt | ||
| mapca.egg-info/dependency_links.txt | ||
| mapca.egg-info/not-zip-safe | ||
| mapca.egg-info/requires.txt | ||
| mapca.egg-info/top_level.txt | ||
| mapca/tests/__init__.py | ||
| mapca/tests/conftest.py | ||
| mapca/tests/test_integration.py | ||
| mapca/tests/test_mapca.py | ||
| mapca/tests/test_utils.py |
| mapca |
-65
| """ | ||
| Stub file for a guaranteed safe import of duecredit constructs: if duecredit | ||
| is not available. | ||
| To use it, place it into your project codebase to be imported, e.g. copy as | ||
| cp stub.py /path/tomodule/module/due.py | ||
| Note that it might be better to avoid naming it duecredit.py to avoid shadowing | ||
| installed duecredit. | ||
| Then use in your code as | ||
| from .due import due, Doi, BibTeX | ||
| See https://github.com/duecredit/duecredit/blob/master/README.md for examples. | ||
| Origin: Originally a part of the duecredit | ||
| Copyright: 2015-2016 DueCredit developers | ||
| License: BSD-2 | ||
| """ | ||
| __version__ = "0.0.5" | ||
| class InactiveDueCreditCollector(object): | ||
| """Just a stub at the Collector which would not do anything""" | ||
| def _donothing(self, *args, **kwargs): | ||
| """Perform no good and no bad""" | ||
| pass | ||
| def dcite(self, *args, **kwargs): | ||
| """If I could cite I would""" | ||
| def nondecorating_decorator(func): | ||
| return func | ||
| return nondecorating_decorator | ||
| cite = load = add = _donothing | ||
| def __repr__(self): | ||
| return self.__class__.__name__ + "()" | ||
| def _donothing_func(*args, **kwargs): | ||
| """Perform no good and no bad""" | ||
| pass | ||
| try: | ||
| from duecredit import due, BibTeX, Doi, Url | ||
| if "due" in locals() and not hasattr(due, "cite"): | ||
| raise RuntimeError("Imported due lacks .cite. DueCredit is now disabled") | ||
| except Exception as e: | ||
| if type(e).__name__ != "ImportError": | ||
| import logging | ||
| logging.getLogger("duecredit").error("Failed to import duecredit due to %s" % str(e)) | ||
| # Initiate due stub | ||
| due = InactiveDueCreditCollector() | ||
| BibTeX = Doi = Url = _donothing_func | ||
| # Emacs mode definitions | ||
| # Local Variables: | ||
| # mode: python | ||
| # py-indent-offset: 4 | ||
| # tab-width: 4 | ||
| # indent-tabs-mode: nil | ||
| # End: |
-108
| # -*- coding: utf-8 -*- | ||
| # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- | ||
| # vi: set ft=python sts=4 ts=4 sw=4 et: | ||
| """ | ||
| Base module variables | ||
| """ | ||
| import importlib.util | ||
| import json | ||
| import os.path as op | ||
| from pathlib import Path | ||
| # Get version | ||
| spec = importlib.util.spec_from_file_location( | ||
| "_version", op.join(op.dirname(__file__), "mapca/_version.py") | ||
| ) | ||
| _version = importlib.util.module_from_spec(spec) | ||
| spec.loader.exec_module(_version) | ||
| VERSION = _version.get_versions()["version"] | ||
| del _version | ||
| # Get list of authors from Zenodo file | ||
| with open(op.join(op.dirname(__file__), ".zenodo.json"), "r") as fo: | ||
| zenodo_info = json.load(fo) | ||
| authors = [author["name"] for author in zenodo_info["creators"]] | ||
| author_names = [] | ||
| for author in authors: | ||
| if ", " in author: | ||
| author_names.append(author.split(", ")[1] + " " + author.split(", ")[0]) | ||
| else: | ||
| author_names.append(author) | ||
| # Get package description from README | ||
| # Since this file is executed from ../setup.py, the path to the README is determined by the | ||
| # location of setup.py. | ||
| readme_path = Path(__file__).parent.joinpath("README.md") | ||
| longdesc = readme_path.open().read() | ||
| # Fields | ||
| AUTHOR = "mapca developers" | ||
| COPYRIGHT = "Copyright 2020, mapca developers" | ||
| CREDITS = author_names | ||
| LICENSE = "GPL-2.0" | ||
| MAINTAINER = "Eneko Urunuela" | ||
| EMAIL = "e.urunuela@bcbl.eu" | ||
| STATUS = "Prototype" | ||
| URL = "https://github.com/me-ica/mapca" | ||
| PACKAGENAME = "mapca" | ||
| DESCRIPTION = ( | ||
| "A Python implementation of the moving average principal components analysis " | ||
| "methods from GIFT." | ||
| ) | ||
| LONGDESC = longdesc | ||
| DOWNLOAD_URL = "https://github.com/ME-ICA/{name}/archive/{ver}.tar.gz".format( | ||
| name=PACKAGENAME, ver=VERSION | ||
| ) | ||
| REQUIRES = [ | ||
| "nibabel>=2.5.1", | ||
| "nilearn", | ||
| "numpy>=1.15", | ||
| "scikit-learn>=0.22", | ||
| "scipy>=1.3.3", | ||
| ] | ||
| TESTS_REQUIRES = [ | ||
| "codecov", | ||
| "coverage<5.0", | ||
| "flake8>=3.7", | ||
| "pytest", | ||
| "pytest-cov", | ||
| "requests", | ||
| ] | ||
| EXTRA_REQUIRES = { | ||
| "dev": ["versioneer"], | ||
| "doc": [ | ||
| "sphinx>=1.5.3", | ||
| "sphinx_rtd_theme", | ||
| "sphinx-argparse", | ||
| ], | ||
| "tests": TESTS_REQUIRES, | ||
| "duecredit": ["duecredit"], | ||
| } | ||
| ENTRY_POINTS = {} | ||
| # Enable a handle to install all extra dependencies at once | ||
| EXTRA_REQUIRES["all"] = list(set([v for deps in EXTRA_REQUIRES.values() for v in deps])) | ||
| # Supported Python versions using PEP 440 version specifiers | ||
| # Should match the same set of Python versions as classifiers | ||
| PYTHON_REQUIRES = ">=3.5" | ||
| # Package classifiers | ||
| CLASSIFIERS = [ | ||
| "Development Status :: 4 - Beta", | ||
| "Intended Audience :: Science/Research", | ||
| "Topic :: Scientific/Engineering :: Information Analysis", | ||
| "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", | ||
| "Programming Language :: Python :: 3.5", | ||
| "Programming Language :: Python :: 3.6", | ||
| "Programming Language :: Python :: 3.7", | ||
| "Programming Language :: Python :: 3.8", | ||
| "Programming Language :: Python :: 3.9", | ||
| ] |
-22
| [versioneer] | ||
| vcs = git | ||
| style = pep440 | ||
| versionfile_source = mapca/_version.py | ||
| versionfile_build = mapca/_version.py | ||
| tag_prefix = | ||
| parentdir_prefix = | ||
| [flake8] | ||
| max-line-length = 99 | ||
| exclude = *build/ | ||
| ignore = E126,E203,E402,E722,W503,W504 | ||
| per-file-ignores = | ||
| */__init__.py:F401 | ||
| [tool:pytest] | ||
| log_cli = true | ||
| [egg_info] | ||
| tag_build = | ||
| tag_date = 0 | ||
-55
| #!/usr/bin/env python | ||
| # -*- coding: utf-8 -*- | ||
| """ mapca setup script """ | ||
| def main(): | ||
| """ Install entry-point """ | ||
| import os.path as op | ||
| import versioneer | ||
| from inspect import getfile, currentframe | ||
| from io import open | ||
| from setuptools import setup, find_packages | ||
| ver_file = op.join("mapca", "info.py") | ||
| with open(ver_file) as f: | ||
| exec(f.read()) | ||
| vars = locals() | ||
| root_dir = op.dirname(op.abspath(getfile(currentframe()))) | ||
| cmdclass = versioneer.get_cmdclass() | ||
| pkg_data = { | ||
| "mapca": [ | ||
| "tests/data/*", | ||
| ] | ||
| } | ||
| setup( | ||
| name=vars["PACKAGENAME"], | ||
| version=vars["VERSION"], | ||
| description=vars["DESCRIPTION"], | ||
| long_description=vars["LONGDESC"], | ||
| long_description_content_type="text/markdown", | ||
| author=vars["AUTHOR"], | ||
| author_email=vars["EMAIL"], | ||
| maintainer=vars["MAINTAINER"], | ||
| maintainer_email=vars["EMAIL"], | ||
| url=vars["URL"], | ||
| license=vars["LICENSE"], | ||
| classifiers=vars["CLASSIFIERS"], | ||
| download_url=vars["DOWNLOAD_URL"], | ||
| # Dependencies handling | ||
| python_requires=vars["PYTHON_REQUIRES"], | ||
| install_requires=vars["REQUIRES"], | ||
| tests_require=vars["TESTS_REQUIRES"], | ||
| extras_require=vars["EXTRA_REQUIRES"], | ||
| entry_points=vars["ENTRY_POINTS"], | ||
| packages=find_packages(exclude=("tests",)), | ||
| zip_safe=False, | ||
| cmdclass=cmdclass, | ||
| ) | ||
| if __name__ == "__main__": | ||
| main() |
Sorry, the diff of this file is too big to display
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
25
4.17%106761
-14.25%1078
-60.73%