Skip to content

Commit b206ede

Browse files
authored
Merge branch 'main' into fix-local-testing
2 parents c7a8ed5 + 3c4c54b commit b206ede

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

babs/bootstrap.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import os.path as op
55
import subprocess
6+
import tempfile
67
from pathlib import Path
78

89
import datalad.api as dlapi
@@ -77,8 +78,11 @@ def babs_bootstrap(
7778
f"The parent folder '{parent_dir}' does not exist! `babs init` won't proceed."
7879
)
7980

80-
# check if parent directory is writable:
81-
if not os.access(parent_dir, os.W_OK):
81+
# check if parent directory is writable (os.access unreliable on NFS/ACL):
82+
try:
83+
with tempfile.TemporaryFile(dir=parent_dir):
84+
pass
85+
except OSError:
8286
raise ValueError(
8387
f"The parent folder '{parent_dir}' is not writable! `babs init` won't proceed."
8488
)

babs/templates/participant_job.sh.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,6 @@ datalad push --to output-storage
164164
echo '# Push the branch with provenance records:'
165165
# DSLOCKFILE set by sbatch --export= in container.py
166166
# shellcheck disable=SC2154
167-
flock "${DSLOCKFILE}" git push outputstore
167+
flock "${DSLOCKFILE}" git push outputstore "${BRANCH}"
168168

169169
echo SUCCESS

babs/utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,12 @@ def update_results_status(
648648
& ~updated_results_df['state'].isin(['PD', 'R'])
649649
)
650650

651-
# Drop the completion columns
652-
updated_results_df = updated_results_df.drop(
653-
columns=['job_id_completion', 'task_id_completion']
654-
)
651+
# Drop all completion columns (job_id, task_id, and any other overlapping
652+
# columns like ses_id_completion when use_sesid was False in a prior run)
653+
completion_suffix_columns = [
654+
col for col in updated_results_df.columns if col.endswith('_completion')
655+
]
656+
updated_results_df = updated_results_df.drop(columns=completion_suffix_columns)
655657

656658
return updated_results_df
657659

docs/walkthrough.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,13 @@ and results and provenance are saved. An example command of ``babs init`` is as
354354
--queue slurm \
355355
"${HOME}/babs_demo/my_BABS_project"
356356
357+
Retrieve the container:
358+
359+
.. code-block:: console
360+
361+
$ cd "${HOME}/babs_demo/my_BABS_project/analysis"
362+
$ datalad get -r containers
363+
357364
.. note::
358365
**Optional: Throttling array jobs**: If you have many jobs and want to limit how many
359366
run simultaneously, you can add ``--throttle <number>`` to the command above.

0 commit comments

Comments
 (0)