Skip to content

Commit

Permalink
Merge pull request #128 from liuzhenqi77/update-package
Browse files Browse the repository at this point in the history
Package structure maintenance
  • Loading branch information
liuzhenqi77 authored Nov 30, 2023
2 parents 89aec5b + 5b81888 commit c1cdfa0
Show file tree
Hide file tree
Showing 52 changed files with 1,512 additions and 1,010 deletions.
9 changes: 9 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true
comment: false
22 changes: 0 additions & 22 deletions .github/workflows/codespell.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: publish-docker-image

on:
workflow_dispatch:
push:
branches:
- 'main'
Expand All @@ -14,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/[email protected]
Expand Down
72 changes: 34 additions & 38 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,40 @@
name: deploy-docs
name: neuromaps-docs

on:
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- 'tools/**'
branches:
- main

jobs:
deploy-book:
deploy_page:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Install dependencies
run: |
pip install -r docs/requirements.txt
while true; do
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 --no-dns-cache -c \
https://www.humanconnectome.org/storage/app/media/workbench/workbench-linux64-v1.5.0.zip && break
done
unzip workbench-linux64-v1.5.0.zip -d ${HOME}
echo "$HOME/workbench/bin_linux64" >> $GITHUB_PATH
- name: Install neuromaps
run: |
pip install ./
- name: Build the docs
run: |
cd docs && make clean html
- name: GitHub Pages action
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
commit_message: ${{ github.event.head_commit.message }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install -r docs/requirements.txt
while true; do
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 --no-dns-cache -c \
https://www.humanconnectome.org/storage/app/media/workbench/workbench-linux64-v1.5.0.zip && break
done
unzip workbench-linux64-v1.5.0.zip -d ${HOME}
echo "$HOME/workbench/bin_linux64" >> $GITHUB_PATH
- name: Install neuromaps
run: |
pip install .
- name: Build the docs
run: |
cd docs && make clean html
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'docs/_build/html'
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2
118 changes: 53 additions & 65 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,93 +1,81 @@
name: run-tests
name: neuromaps-tests

on: [push, pull_request]

defaults:
run:
shell: bash
on:
workflow_dispatch:
push:
branches:
- main
pull_request:

jobs:
check_skip:
check_style:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.result_step.outputs.ci-skip }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: result_step
uses: mstachniuk/ci-skip@master
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
commit-filter: '[skip ci];[ci skip];[skip github]'
commit-filter-separator: ';'

checks:
needs: check_skip
if: ${{ needs.check_skip.outputs.skip == 'false' }}
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ruff
- name: Run style checks
run: ruff .
codespell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run codespell
uses: codespell-project/actions-codespell@v2

run_tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.7', '3.8', '3.9']
architecture: ['x64', 'x86']
install: ['setup']
check: ['test']
optional-depends: ['']
include:
- os: ubuntu-latest
python-version: 3.8
install: setup
check: style
optional-depends: ''
- os: ubuntu-latest
python-version: 3.8
install: setup
check: doc
optional-depends: ''
- os: ubuntu-latest
python-version: 3.8
install: sdist
check: test
optional-depends: ''
- os: ubuntu-latest
python-version: 3.8
install: wheel
check: test
optional-depends: ''
exclude:
- os: ubuntu-latest
architecture: x86
- os: macos-latest
architecture: x86
env:
INSTALL_TYPE: ${{ matrix.install }}
CHECK_TYPE: ${{ matrix.check }}
OPTIONAL_DEPENDS: ${{ matrix.optional-depends }}
python-version: ['3.8', '3.9', '3.10']
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: ./tools/install_dependencies.sh
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install pytest pytest-cov codecov
python -m pip install git+https://github.com/netneurolab/netneurotools
- name: Install connectome workbench
run: |
while true; do
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 --no-dns-cache -c \
https://www.humanconnectome.org/storage/app/media/workbench/workbench-linux64-v1.5.0.zip && break
done
unzip workbench-linux64-v1.5.0.zip -d ${HOME}
echo "$HOME/workbench/bin_linux64" >> $GITHUB_PATH
- name: Install neuromaps
run: ./tools/install_package.sh
run: python -m pip install -e .
- name: Print neuromaps version
run: python -c "import neuromaps; print(neuromaps.__version__)"
- name: Run tests
run: ./tools/run_checks.sh
- uses: codecov/codecov-action@v1
run: pytest --doctest-modules --cov=neuromaps --cov-report=xml --junitxml=junit/test-results.xml --verbose --pyargs neuromaps
- uses: codecov/codecov-action@v3
with:
file: for_testing/coverage.xml
if: ${{ always() }}
files: ./coverage.xml
verbose: true
- name: Upload pytest test results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
path: for_testing/test-results.xml
if: ${{ always() && matrix.check == 'test' }}
path: junit/test-results.xml
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,6 @@ ENV/
.ropeproject

.imdone

# Ruff
.ruff_cache/
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# Add project name, copyright holder, and author(s)
project = 'neuromaps'
copyright = '2021, neuromaps developers'
copyright = '2021-2023, neuromaps developers'
author = 'Network Neuroscience Lab'

# Import project to get version info
Expand Down Expand Up @@ -62,7 +62,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down Expand Up @@ -101,7 +101,7 @@

# -- Extension configuration -------------------------------------------------
intersphinx_mapping = {
'python': ('https://docs.python.org/3.6', None),
'python': ('https://docs.python.org', None),
'matplotlib': ('https://matplotlib.org', None),
'numpy': ('https://docs.scipy.org/doc/numpy', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-r ../requirements.txt
sphinx>=2.0
sphinx >=2.0, <7.0.0
sphinx_rtd_theme
sphinx-gallery
10 changes: 2 additions & 8 deletions neuromaps/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
__all__ = ['resample_images', 'compare_images']

from neuromaps.resampling import resample_images
from neuromaps.stats import compare_images

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
from . import _version
__version__ = _version.get_versions()['version']
Loading

0 comments on commit c1cdfa0

Please sign in to comment.