-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add datalad run-procedure interface for un/repack-studyspec scripts
- Loading branch information
Showing
5 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
[datalad "dataset"] | ||
id = badd1ad0-1819-11ea-a1e8-a0369f7c647e | ||
|
||
[datalad "locations"] | ||
dataset-procedures = procedures | ||
|
||
[datalad "procedures.unpack-studyspec"] | ||
call-format = "bash {script} {args}" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
pvavra
Author
Owner
|
||
help = "helper to convert studyspec.json into valid-json format" | ||
|
||
[datalad "procedures.repack-studyspec"] | ||
call-format = "bash {script} {args}" | ||
help = "helper to convert valid-json into studyspec.json format" |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
# simple wrapper around helpers/repack-studyspec.py which will call datalad run | ||
|
||
set -e -u | ||
set -x | ||
|
||
if [ "$#" -gt 1 ] | ||
then | ||
datalad run --explicit --input "$1" --output "$2" python helplers/repack-studyspec.py "$1" "$2" | ||
else | ||
datalad run --explicit --input "$1" --output "$1" python helplers/repack-studyspec.py "$1" "$1" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
# simple wrapper around helpers/unpack-studyspec.py which will call datalad run | ||
|
||
set -e -u | ||
set -x | ||
|
||
if [ "$#" -gt 1 ] | ||
then | ||
datalad run --explicit --input "$1" --output "$2" python helplers/unpack-studyspec.py "$1" "$2" | ||
else | ||
datalad run --explicit --input "$1" --output "$1" python helplers/unpack-studyspec.py "$1" "$1" | ||
fi |
Something you might not be aware of:
By leaving out
{ds}
in that call-format and subsequently not using it within the procedure you might encounter unintended sideeffects.datalad run-procedure unpack-studyspec
may be called with--dataset /some/path
. But thedatalad-run
call with that procedure now doesn't know about that dataset to operate on and will rely on CWD of its process to figure the dataset to save to, look for relative paths in and possibly get missing content in. If that resolves to two different datasets the resulting behavior/failure might not be easy to grasp.