Skip to content

Commit 5a138f5

Browse files
authored
Merge pull request #360 from mgxd/rf/fit-apply
RF: Move to fit/apply workflow
2 parents f93aba7 + 3881973 commit 5a138f5

File tree

96 files changed

+13485
-9911
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+13485
-9911
lines changed

.codespellrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[codespell]
2+
skip = .git,*.pdf,*.svg,*.html,dataset_description.json,*.bib
3+
# te - TE
4+
# Weill - name
5+
# reson - Reson. abbreviation in citation
6+
ignore-words-list = te,weill,reson

.github/workflows/style.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Style check
1+
name: Style + spelling check
22

33
on:
44
push:
@@ -11,30 +11,27 @@ defaults:
1111
run:
1212
shell: bash
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
1418
permissions:
1519
contents: read
1620

1721
jobs:
18-
build:
19-
if: "!contains(github.event.head_commit.message, '[skip ci]')"
22+
style:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- run: pipx run ruff check .
27+
- run: pipx run ruff format --diff .
28+
29+
codespell:
30+
name: Check for spelling errors
2031
runs-on: ubuntu-latest
21-
strategy:
22-
matrix:
23-
python-version: ['3.11']
2432

2533
steps:
26-
- uses: actions/checkout@v4
27-
with:
28-
fetch-depth: 1 # Only fetch the latest commit
29-
- name: Set up Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v5
31-
with:
32-
python-version: ${{ matrix.python-version }}
33-
- name: Install dependencies
34-
run: |
35-
pip install black isort
36-
- name: black code formatting check
37-
run: |
38-
black --check nibabies/
39-
- name: isort formatting check
40-
run: isort nibabies/ --check-only
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
- name: Codespell
37+
uses: codespell-project/actions-codespell@v2

.maint/contributors.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[
2+
{
3+
"affiliation": "Department of Pediatrics, University of Minnesota, MN, USA",
4+
"name": "Madison, Thomas",
5+
"orcid": "0000-0003-3030-6580"
6+
},
27
{
38
"affiliation": "Montreal Neurological Institute, McGill University",
49
"name": "Huberty, Scott",

.pre-commit-config.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1+
exclude: ".*/data/.*"
12
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v2.4.0
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.4.0
45
hooks:
5-
- id: trailing-whitespace
6-
- id: end-of-file-fixer
7-
- id: check-yaml
8-
- id: check-added-large-files
9-
- repo: https://github.com/psf/black
10-
rev: 22.3.0
6+
- id: trailing-whitespace
7+
exclude: '.*\.svg'
8+
- id: end-of-file-fixer
9+
exclude: '.*\.svg'
10+
- id: check-yaml
11+
- id: check-json
12+
- id: check-toml
13+
- id: check-added-large-files
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.2.0
1116
hooks:
12-
- id: black
13-
files: ^nibabies/
14-
- repo: https://github.com/pycqa/isort
15-
rev: 5.10.1
16-
hooks:
17-
- id: isort
18-
files: ^nibabies/
17+
- id: ruff
18+
- id: ruff-format

.readthedocs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: ubuntu-22.04
55
tools:
6-
python: "3.10"
6+
python: "3.11"
77
jobs:
88
post_checkout:
99
- git fetch --unshallow
@@ -15,3 +15,5 @@ python:
1515
path: .
1616
extra_requirements:
1717
- doc
18+
- method: pip
19+
path: wrapper/

CHANGES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ Previous, *NiBabies* expected input from the `--derivatives` flag to be in T1w s
3636
* DKR: Add M-CRIB-S to Docker container (#283)
3737
* DKR: Update dependencies, split into multi-stage build
3838
* ENH: Add option to exclude projecting high variance voxels to surface (#278)
39-
* ENH: Resample morphometrics to fsLR CIFTI-2 files when outputing CIFTIs (#279)
39+
* ENH: Resample morphometrics to fsLR CIFTI-2 files when outputting CIFTIs (#279)
4040
* ENH: Add MCRIBReconAll as alternative surface reconstruction method (#283)
41-
* ENH: Reorder anatomical processsing, run ANTs DenoiseImage on anatomicals (#286)
41+
* ENH: Reorder anatomical processing, run ANTs DenoiseImage on anatomicals (#286)
4242
* ENH: Extract participant ages from BIDS sources, deprecate `--age-months` (#287)
4343
* ENH: Dilate BOLD mask by 2 voxels to prevent over-aggressive masking degrading T2star map estimation (#296)
4444
* ENH: Allow precomputed derivatives in T1w or T2w space (#305)

Dockerfile

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
# SOFTWARE.
2424

2525
# Ubuntu 22.04 LTS - Jammy
26-
ARG BASE_IMAGE=ubuntu:jammy-20230605
26+
ARG BASE_IMAGE=ubuntu:jammy-20240405
2727

2828
# NiBabies wheel
2929
FROM python:slim AS src
3030
RUN pip install build
3131
RUN apt-get update && \
3232
apt-get install -y --no-install-recommends git
33-
COPY . /src/nibabies
34-
RUN python -m build /src/nibabies
33+
COPY . /src
34+
RUN python -m build /src
3535

3636
# Older Python to support legacy MCRIBS
3737
FROM python:3.6.15-slim as pyenv
@@ -90,19 +90,26 @@ RUN mkdir /opt/workbench && \
9090

9191
# Micromamba
9292
FROM downloader as micromamba
93+
94+
# Install a C compiler to build extensions when needed.
95+
# traits<6.4 wheels are not available for Python 3.11+, but build easily.
96+
RUN apt-get update && \
97+
apt-get install -y --no-install-recommends build-essential && \
98+
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
99+
93100
WORKDIR /
94101
# Bump the date to current to force update micromamba
95-
RUN echo "2023.06.29"
96-
RUN curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
102+
RUN echo "2024.04.25" && curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
97103
ENV MAMBA_ROOT_PREFIX="/opt/conda"
98104
COPY env.yml /tmp/env.yml
105+
COPY requirements.txt /tmp/requirements.txt
106+
WORKDIR /tmp
99107
RUN micromamba create -y -f /tmp/env.yml && \
100108
micromamba clean -y -a
109+
101110
ENV PATH="/opt/conda/envs/nibabies/bin:$PATH"
102-
RUN /opt/conda/envs/nibabies/bin/npm install -g svgo@^2.8 bids-validator@1.11.0 && \
111+
RUN npm install -g svgo@^3.2.0 bids-validator@^1.14.0 && \
103112
rm -r ~/.npm
104-
COPY requirements.txt /tmp/requirements.txt
105-
RUN /opt/conda/envs/nibabies/bin/pip install --no-cache-dir -r /tmp/requirements.txt
106113

107114
# Main container
108115
FROM ${BASE_IMAGE} as nibabies
@@ -207,7 +214,7 @@ ENV PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
207214
PATH="$FREESURFER_HOME/bin:$FREESURFER_HOME/tktools:$MINC_BIN_DIR:$PATH"
208215

209216
# MCRIBS (required legacy python)
210-
COPY --from=nipreps/mcribs@sha256:6c7a8dedd61d0ead8c7c4a57ab158928c1c1d787d87dae33ab7ee43226fb1e0f /opt/MCRIBS/ /opt/MCRIBS
217+
COPY --from=nipreps/mcribs@sha256:d5ea7616402cbc0b80f32634832dce540a32bb1d5e1e61dfdd2cc795dba8944a /opt/MCRIBS/ /opt/MCRIBS
211218
COPY --from=pyenv /usr/local/lib/ /usr/local/lib/
212219
ENV PATH="/opt/MCRIBS/bin:/opt/MCRIBS/MIRTK/MIRTK-install/bin:/opt/MCRIBS/MIRTK/MIRTK-install/lib/tools:${PATH}" \
213220
LD_LIBRARY_PATH="/opt/MCRIBS/lib:/opt/MCRIBS/ITK/ITK-install/lib:/opt/MCRIBS/VTK/VTK-install/lib:/opt/MCRIBS/MIRTK/MIRTK-install/lib:/usr/local/lib:${LD_LIBRARY_PATH}" \
@@ -257,7 +264,7 @@ RUN ${CONDA_PYTHON} -m pip install --no-cache-dir --upgrade templateflow && \
257264
find $HOME/.cache/templateflow -type f -exec chmod go=u {} +
258265

259266
# Install pre-built wheel
260-
COPY --from=src /src/nibabies/dist/*.whl .
267+
COPY --from=src /src/dist/*.whl .
261268
RUN ${CONDA_PYTHON} -m pip install --no-cache-dir $( ls *.whl )[telemetry,test]
262269

263270
# Facilitate Apptainer use

docs/community.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## NiPreps Community
22

3-
Check out the [official NiPreps community page](https://www.nipreps.org/community/), where topics such as contributing, code of coduct, and licensing are outlined.
3+
Check out the [official NiPreps community page](https://www.nipreps.org/community/), where topics such as contributing, code of conduct, and licensing are outlined.
44

55

66
## NiBabies Coding Style

0 commit comments

Comments
 (0)