Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelzwiers committed Feb 5, 2025
1 parent a40a534 commit 4a78706
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion bidscoin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,12 @@ def trackusage(event: str, dryrun: bool=False) -> dict:

except Exception as shelveerror:
warnings.warn(f"Please report the following error to the developers:\n{shelveerror}: {trackfile}", RuntimeWarning)
for corruptfile in trackfile.parent.glob(trackfile.name + '.*'):
for corruptfile in shelvefiles := list(trackfile.parent.glob(trackfile.name + '.*')):
print(f"Deleting corrupt file: {corruptfile}")
corruptfile.unlink()
data['event'] = 'trackusage_exception'
if not shelvefiles: # Return without uploading (no shelve files means no sleep)
return data

# Upload the usage data
try:
Expand Down
2 changes: 1 addition & 1 deletion bidscoin/cli/_bidsmapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_parser() -> argparse.ArgumentParser:
parser.add_argument('-u','--unzip', help='Wildcard pattern to unpack tarball/zip-files in the sub/ses sourcefolder that need to be unzipped (in a tempdir) to make the data readable. Default: the value of the study/template bidsmap', metavar='PATTERN')
parser.add_argument('-s','--store', help='Store newly discovered data samples in the bidsfolder/code/provenance folder (useful for editing e.g. zipped or transferred datasets)', action='store_true')
parser.add_argument('-a','--automated', help='Save the automatically generated bidsmap to disk and without interactively tweaking it with the bidseditor', action='store_true')
parser.add_argument('-f','--force', help='Discard the previously saved bidsmap and logfile', action='store_true')
parser.add_argument('-f','--force', help='Discard the previously saved bidsmap and log file, instead of re-using them (use this option for a fresh start)', action='store_true')
parser.add_argument('--no-update', help="Do not update any sub-/ses-prefixes in or prepend the sourcefolder name to the <<filepath:regex>> expression that extracts the subject/session labels. This is normally done to make the extraction more robust, but could cause problems for certain use cases", action='store_true')

return parser
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ The bidscoiner no longer sometimes crashes when dcm2niix produces custom suffixe
- Separate tabs for DICOM and PAR to edit all the mappings of mixed datasets in a single bidseditor session
- Run-item matching on filesystem properties, i.e. on the pathname, filename and filesize and nr of files in the folder. This can be used in conjunction with the (DICOM/PAR) attributes
- A metadata dictionary that can be edited with the bidseditor and that will be added to the json sidecar files by the bidscoiner
- More user feedback in the GUI for new BIDS-compliancy checks on missing or invalid bids data
- More user feedback in the GUI for new BIDS-compliance checks on missing or invalid BIDS data
- A right-click menu option to remove a run-item from the bidsmap (advanced usage)
- The option to load a new bidsmap in the bidseditor
- Enable the user to edit json, yaml, tsv and other non-DICOM/non-PAR files with double-clicks in the data browser
Expand Down
1 change: 0 additions & 1 deletion docs/_static/dictionary-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ bugfixes
bval
bvec
cli
compliancy
conda
config
copymetadata
Expand Down
3 changes: 2 additions & 1 deletion docs/workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ Here is how to run the bidsmapper command:
(useful for editing e.g. zipped or transferred datasets)
-a, --automated Save the automatically generated bidsmap to disk and without interactively
tweaking it with the bidseditor
-f, --force Discard the previously saved bidsmap and log file
-f, --force Discard the previously saved bidsmap and log file, instead of re-using them
(use this option for a fresh start)
--no-update Do not update any sub-/ses-prefixes in or prepend the sourcefolder name to the
<<filepath:regex>> expression that extracts the subject/session labels. This
is normally done to make the extraction more robust, but could cause problems
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ commands = make -C docs html
skip = '.git,*.pdf,*.svg,go.sum'
check-hidden = true
ignore-regex = '\b(PULS|TE|ALS)\b'
ignore-words-list = 'compliancy,uptodate,mis'
ignore-words-list = 'uptodate,mis'
6 changes: 3 additions & 3 deletions release_procedure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ DCCN deployment
source activate /opt/bidscoin
bidscoin -v
bidscoin -t
conda deactivate bidscoin
conda deactivate

4. Post a release message on the MM data management channel

Expand Down Expand Up @@ -92,20 +92,20 @@ Dockerhub
sudo docker run --rm marcelzwiers/bidscoin:$VERSION pngappend
sudo docker run --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix marcelzwiers/bidscoin:$VERSION bidscoin -t
sudo docker push marcelzwiers/bidscoin:$VERSION
sudo docker system prune -a

Neurodesk
---------

1. Pull and edit the bidscoin neurocontainer in a separate release branch
2. Build and test a neurodocker image::
2. In the VM, build and test a neurodocker image::

VERSION="4.5.0"
cd ~/PycharmProjects/neurocontainers/recipes/bidscoin
conda activate neurodocker
./build.sh -ds
sudo docker image list # Checkout the TAG
sudo docker run --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix bidscoin_${VERSION}:TAG bidscoin -t
sudo docker system prune -a

3. Create a neurocontainers PR from the release branch

Expand Down

0 comments on commit 4a78706

Please sign in to comment.