Skip to content

Commit

Permalink
Merge branch 'master' into Project-endpoint-data-to-streamlines
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamlittlephd committed Feb 7, 2024
2 parents 507df9f + d9736d9 commit 0c19111
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 159 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/build.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/freeze_requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
freeze_requirements:
runs-on: ubuntu-latest
runs-on: scilus-runners
steps:
-
name: Checkout scilpy
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Scilpy test suite

on:
push:
branches:
- master
pull_request_target:
branches:
- master

env:
MPLBACKEND: agg
OPENBLAS_NUM_THREADS: 1

jobs:
test:
runs-on: scilus-runners
steps:
- name: Checkout repository
uses: actions/[email protected]

- name: Fetch python version from repository
id: python-selector
run: echo "python-version=$(cat .python-version)" >> $GITHUB_OUTPUT

- name: Set up Python for Scilpy
uses: actions/[email protected]
with:
python-version: ${{ steps.python-selector.outputs.python-version }}
cache: 'pip'

- name: Install non-python dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
curl \
git \
libblas-dev \
liblapack-dev \
libfreetype6-dev
- name: Install Scilpy
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e .
- name: Run tests
run: |
export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH
pytest --cov-report term-missing:skip-covered
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
flags: unittests
name: scilpy-unittests-${{ github.run_id }}
verbose: true
directory: .test_reports/
fail_ci_if_error: true
root_dir: $GITHUB_WORKSPACE/scilpy/

- name: Upload test reports and coverage to artifacts
uses: actions/[email protected]
with:
name: test-reports
path: |
.test_reports/*
121 changes: 0 additions & 121 deletions Jenkinsfile

This file was deleted.

1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include LICENSE
include requirements.txt
include .python-version

recursive-include data/LUT *
recursive-include scilpy *.c
recursive-include scilpy *.cpp
recursive-include scilpy *.pyx
4 changes: 3 additions & 1 deletion scripts/scil_tractogram_assign_custom_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ def main():
data = np.clip(data, np.quantile(data, 0.05),
np.quantile(data, 0.95))
elif args.use_dpp:
data = np.squeeze(sft.data_per_point[args.use_dpp]._data)
tmp = [np.squeeze(sft.data_per_point[args.use_dpp][s]) for s in
range(len(sft))]
data = np.hstack(tmp)
elif args.load_dps:
data = np.squeeze(load_matrix_in_any_format(args.load_dps))
if len(data) != len(sft):
Expand Down
7 changes: 3 additions & 4 deletions scripts/scil_tractogram_filter_by_anatomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import json
import logging
import os
import pkg_resources
import importlib.resources as resources

from dipy.io.streamline import save_tractogram
from dipy.io.utils import is_header_compatible
Expand Down Expand Up @@ -142,9 +142,8 @@ def load_wmparc_labels():
Load labels dictionary of different parcellations from the
Desikan-Killiany atlas
"""
resource_package = pkg_resources.get_distribution('scilpy').location
labels_path = os.path.join(
resource_package, 'data/LUT/dk_aggregate_structures.json')
lut_package = resources.files('data').joinpath('LUT')
labels_path = lut_package.joinpath('dk_aggregate_structures.json')
with open(labels_path) as labels_file:
labels = json.load(labels_file)
return labels
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


def test_help_option(script_runner):
ret = script_runner.run('scil_assign_custom_color_to_tractogram.py',
ret = script_runner.run('scil_tractogram_assign_custom_color.py',
'--help')
assert ret.success

Expand All @@ -24,7 +24,7 @@ def test_execution_tractometry(script_runner):
'IFGWM.trk')
in_anat = os.path.join(get_home(), 'tractometry',
'IFGWM_labels_map.nii.gz')
ret = script_runner.run('scil_assign_custom_color_to_tractogram.py',
ret = script_runner.run('scil_tractogram_assign_custom_color.py',
in_bundle, 'colored.trk', '--from_anatomy',
in_anat)
assert ret.success
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


def test_help_option(script_runner):
ret = script_runner.run('scil_assign_uniform_color_to_tractograms.py',
ret = script_runner.run('scil_tractogram_assign_uniform_color.py',
'--help')
assert ret.success

Expand All @@ -22,7 +22,7 @@ def test_execution_tractometry(script_runner):
os.chdir(os.path.expanduser(tmp_dir.name))
in_bundle = os.path.join(get_home(), 'tractometry',
'IFGWM.trk')
ret = script_runner.run('scil_assign_uniform_color_to_tractograms.py',
ret = script_runner.run('scil_tractogram_assign_uniform_color.py',
in_bundle, '--fill_color', '0x000000',
'--out_tractogram', 'colored.trk')
assert ret.success

0 comments on commit 0c19111

Please sign in to comment.