Skip to content

Commit

Permalink
Merge branch 'master' into better_channels_tsv_errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff committed Jul 21, 2022
2 parents 50a0e86 + 54046c1 commit 5f66877
Show file tree
Hide file tree
Showing 24 changed files with 1,252 additions and 735 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/update_submodules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: update submodules

# This workflow will checkout the tracked branch of all submodules
# and will update the submodule pull the latest commit of that submodule branch

# If the branch was not up to date this will then open a PR against the base branch
# in the repo this submodule belongs to.

# ---- WARNING ----
# Currently if the submodule is not tracking the default branch,
# this will workflow will fail.
#

# requires sudmodules URL to be "https..." (no ssh)

# requires submodule to be specified to follow a specific branch (stored in .gitmodules)
#
# clone them with:
#
# git submodule add -b branch_to_follow https://github.com/... submodule_path
#
# or specify it with:
#
# git config -f .gitmodules submodule.submodule_path.branch branch_to_follow
#

# Uses the cron schedule for github actions
#
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#scheduled-events
#
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *

on:
push:
branches:
- master
schedule:
- cron: "0 0 1 * *"

# to trigger update manually from the Action tab in github
workflow_dispatch:
inputs:
log:
description: "Log"
required: false

defaults:
run:
shell: bash

jobs:
update_submodules:
# only trigger update on upstream repo
if: github.repository_owner == 'bids-standard'

runs-on: ubuntu-latest

steps:

- name: Clone repo
uses: actions/checkout@v3
with:
submodules: true

# check out the correct branch for each submodule and pull them all
# https://stackoverflow.com/questions/5828324/update-git-submodule-to-latest-commit-on-origin
- name: Update submodules
run: |
set -e -u
start_dir=$PWD
submodules=$(git submodule | awk '{print $2}')
nb_submod=$(echo "${submodules}" | wc -l)
echo -e "\nUPDATING ${nb_submod} SUBMODULES"
echo -e "${submodules}"
paths=$(git config --file .gitmodules --name-only --get-regexp path)
branches=$(git config --file .gitmodules --name-only --get-regexp branch)
for i in $(seq 1 "${nb_submod}"); do
path=$(echo "${paths}" | awk -v i="${i}" '{print $i}')
path=$(git config --get --file .gitmodules "${path}")
branch=$(echo "${branches}" | awk -v i="${i}" '{print $i}')
branch=$(git config --get --file .gitmodules "${branch}")
echo -e "\nswitching submodule ${path} to ${branch}"
cd "${path}" || exit
git checkout "${branch}"
cd "${start_dir}"
done
git submodule update --remote --merge
# if there have been changes,
# a PR is created using the checkout branch for this workflow
# https://github.com/peter-evans/create-pull-request
- name: Create Pull-Request
uses: peter-evans/create-pull-request@v3
with:
commit-message: Update submodules
delete-branch: true
title: "[BOT] Updating git submodules"
body: "Update git submodules via [CI](https://github.com/bids-standard/bids-validator/blob/master/.github/workflows/update_submodules.yml)."
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "bids-examples"]
path = bids-validator/tests/data/bids-examples
url = https://github.com/bids-standard/bids-examples.git
branch = master
2 changes: 1 addition & 1 deletion bids-validator-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bids-validator-web",
"version": "1.9.4-dev.0",
"version": "1.9.7-dev.0",
"description": "web client for bids-validator",
"main": "index.js",
"license": "MIT",
Expand Down
24 changes: 16 additions & 8 deletions bids-validator/bids_validator/rules/file_level_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@
"_channels\\.tsv",
"_eeg\\.json",
"_coordsystem\\.json",
"_photo\\.jpg"
"_photo\\.jpg",
"_photo\\.png",
"_photo\\.tif"
],
"@@@_cont_ext_@@@": [
"_physio\\.tsv\\.gz",
Expand Down Expand Up @@ -451,7 +453,9 @@
"_channels\\.tsv",
"_ieeg\\.json",
"_coordsystem\\.json",
"_photo\\.jpg"
"_photo\\.jpg",
"_photo\\.png",
"_photo\\.tif"
],
"@@@_cont_ext_@@@": [
"_physio\\.tsv\\.gz",
Expand All @@ -463,7 +467,7 @@
},

"meg": {
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?meg[\\/\\\\]\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_run-[0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(?:_split-[0-9]+)?(_digitizer.txt|_meg(@@@_meg_type_@@@[\\/\\\\](.(?!\\.(sqd|con|fif|raw|raw\\.mhd|trg|kdf|chn)$))*|[\\/\\\\](.(?!\\.(sqd|con|fif|raw|raw\\.mhd|trg|kdf|chn)$))*)|(@@@_meg_ext_@@@)|(?:_recording-[a-zA-Z0-9]+)?(?:@@@_cont_ext_@@@))$",
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?meg[\\/\\\\]\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_run-[0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(?:_split-[0-9]+)?(_digitizer\\.txt|_meg(@@@_meg_type_@@@[\\/\\\\](.(?!\\.(sqd|con|fif|raw|raw\\.mhd|trg|kdf|chn)$))*|[\\/\\\\](.(?!\\.(sqd|con|fif|raw|raw\\.mhd|trg|kdf|chn)$))*)|(@@@_meg_ext_@@@)|(?:_recording-[a-zA-Z0-9]+)?(?:@@@_cont_ext_@@@))$",
"tokens": {
"@@@_meg_type_@@@": [
"\\.ds[\\/\\\\].*",
Expand All @@ -481,6 +485,8 @@
"_meg\\.json",
"_coordsystem\\.json",
"_photo\\.jpg",
"_photo\\.png",
"_photo\\.tif",
"_headshape\\.pos",
"_markers\\.(?:mrk|sqd)"
],
Expand Down Expand Up @@ -548,10 +554,11 @@
"_SPIM"
],
"@@@_microscopy_ext_@@@": [
".ome\\.tif",
".ome\\.btf",
".tif",
".png"
"\\.ome\\.tif",
"\\.ome\\.btf",
"\\.ome\\.zarr[\\/\\\\].*",
"\\.tif",
"\\.png"
]
}
},
Expand All @@ -561,7 +568,8 @@
"@@@_photo_ext_@@@": [
"_photo\\.jpg",
"_photo\\.png",
"_photo\\.tif"
"_photo\\.tif",
"_photo\\.json"
]
}
},
Expand Down
114 changes: 60 additions & 54 deletions bids-validator/bids_validator/rules/session_level_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
"scans": {
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?(@@@_scat_ext_@@@)$",
"tokens": {
"@@@_scat_ext_@@@": ["_scans.tsv", "_scans.json"]
"@@@_scat_ext_@@@": ["_scans\\.tsv", "_scans\\.json"]
}
},

"func_ses": {
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?task-[a-zA-Z0-9]+(?:_acq-[a-zA-Z0-9]+)?(?:_rec-[a-zA-Z0-9]+)?(?:_run-[0-9]+)?(?:_echo-[0-9]+)?(@@@_func_ses_ext_@@@)$",
"tokens": {
"@@@_func_ses_ext_@@@": [
"_bold.json",
"_sbref.json",
"_events.json",
"_events.tsv",
"_physio.json",
"_stim.json"
"_bold\\.json",
"_sbref\\.json",
"_events\\.json",
"_events\\.tsv",
"_physio\\.json",
"_stim\\.json"
]
}
},
Expand All @@ -24,23 +24,23 @@
"regexp": "^\\/(sub-[a-zA-Z0-9]+)\\/(?:(ses-[a-zA-Z0-9]+)\\/)?\\1(_\\2)?(?:_acq-[a-zA-Z0-9]+)?(?:_rec-[a-zA-Z0-9]+)?(?:_run-[0-9]+)?(@@@_asl_ses_ext_@@@)$",
"tokens": {
"@@@_asl_ses_ext_@@@": [
"_asl.json",
"_aslcontext.tsv",
"_m0scan.json",
"_asllabeling.jpg"
"_asl\\.json",
"_aslcontext\\.tsv",
"_m0scan\\.json",
"_asllabeling\\.jpg"
]
}
},

"pet_ses": {
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?(?:_trc-[a-zA-Z0-9]+)?(?:_rec-[a-zA-Z0-9]+)?(?:_task-[a-zA-Z0-9]+)?(?:_run-[0-9]+_)?(@@@_pet_ses_type_@@@)$",
"tokens": {
"@@@_pet_ses_type_@@@": ["_pet.json", "_events.json", "_events.tsv"]
"@@@_pet_ses_type_@@@": ["_pet\\.json", "_events\\.json", "_events\\.tsv"]
}
},

"anat_ses": {
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?(?:_acq-[a-zA-Z0-9]+)?(?:_rec-[a-zA-Z0-9]+)?(?:_run-[0-9]+_)?(@@@_anat_ses_type_@@@).json$",
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?(?:_acq-[a-zA-Z0-9]+)?(?:_rec-[a-zA-Z0-9]+)?(?:_run-[0-9]+_)?(@@@_anat_ses_type_@@@)\\.json$",
"tokens": {
"@@@_anat_ses_type_@@@": [
"T1w",
Expand All @@ -61,7 +61,7 @@
},

"dwi_ses": {
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?(?:_acq-[a-zA-Z0-9]+)?(?:_rec-[a-zA-Z0-9]+)?(?:_run-[0-9]+)?(?:_)?dwi.(?:@@@_dwi_ses_ext_@@@)$",
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?(?:_acq-[a-zA-Z0-9]+)?(?:_rec-[a-zA-Z0-9]+)?(?:_run-[0-9]+)?(?:_)?dwi\\.(?:@@@_dwi_ses_ext_@@@)$",
"tokens": {
"@@@_dwi_ses_ext_@@@": ["json", "bval", "bvec"]
}
Expand All @@ -71,13 +71,15 @@
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(@@@_meg_ses_type_@@@)$",
"tokens": {
"@@@_meg_ses_type_@@@": [
"_events.tsv",
"_channels.tsv",
"_channels.json",
"_meg.json",
"_coordsystem.json",
"_photo.jpg",
"_headshape.pos"
"_events\\.tsv",
"_channels\\.tsv",
"_channels\\.json",
"_meg\\.json",
"_coordsystem\\.json",
"_photo\\.jpg",
"_photo\\.png",
"_photo\\.tif",
"_headshape\\.pos"
]
}
},
Expand All @@ -86,14 +88,16 @@
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(?:_space-(@@@_eeg_space_@@@))?(@@@_eeg_ses_type_@@@)$",
"tokens": {
"@@@_eeg_ses_type_@@@": [
"_events.tsv",
"_channels.tsv",
"_channels.json",
"_electrodes.tsv",
"_electrodes.json",
"_eeg.json",
"_coordsystem.json",
"_photo.jpg"
"_events\\.tsv",
"_channels\\.tsv",
"_channels\\.json",
"_electrodes\\.tsv",
"_electrodes\\.json",
"_eeg\\.json",
"_coordsystem\\.json",
"_photo\\.jpg",
"_photo\\.png",
"_photo\\.tif"
],
"@@@_eeg_space_@@@": [
"Other",
Expand Down Expand Up @@ -149,14 +153,16 @@
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(?:_space-(@@@_ieeg_space_@@@))?(@@@_ieeg_ses_type_@@@)$",
"tokens": {
"@@@_ieeg_ses_type_@@@": [
"_events.tsv",
"_channels.tsv",
"_channels.json",
"_electrodes.tsv",
"_electrodes.json",
"_ieeg.json",
"_coordsystem.json",
"_photo.jpg"
"_events\\.tsv",
"_channels\\.tsv",
"_channels\\.json",
"_electrodes\\.tsv",
"_electrodes\\.json",
"_ieeg\\.json",
"_coordsystem\\.json",
"_photo\\.jpg",
"_photo\\.png",
"_photo\\.tif"
],
"@@@_ieeg_space_@@@": [
"Other",
Expand Down Expand Up @@ -207,23 +213,23 @@
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?(?:_sample-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_stain-[a-zA-Z0-9]+)?(?:_run-[0-9]+_)?(?:_chunk-[0-9]+)?(@@@_microscopy_ses_type_@@@)$",
"tokens": {
"@@@_microscopy_ses_type_@@@": [
"_TEM.json",
"_SEM.json",
"_uCT.json",
"_BF.json",
"_DF.json",
"_PC.json",
"_DIC.json",
"_FLUO.json",
"_CONF.json",
"_PLI.json",
"_CARS.json",
"_2PE.json",
"_MPE.json",
"_SR.json",
"_NLO.json",
"_OCT.json",
"_SPIM.json"
"_TEM\\.json",
"_SEM\\.json",
"_uCT\\.json",
"_BF\\.json",
"_DF\\.json",
"_PC\\.json",
"_DIC\\.json",
"_FLUO\\.json",
"_CONF\\.json",
"_PLI\\.json",
"_CARS\\.json",
"_2PE\\.json",
"_MPE\\.json",
"_SR\\.json",
"_NLO\\.json",
"_OCT\\.json",
"_SPIM\\.json"
]
}
}
Expand Down
Loading

0 comments on commit 5f66877

Please sign in to comment.