Skip to content

Commit

Permalink
A script for dandi/dandi-schema#172 to check consistency of nsubjects
Browse files Browse the repository at this point in the history
  • Loading branch information
DANDI Team committed Apr 10, 2024
1 parent 686336a commit fddb7fb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tools/check_numberOfSubjects
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -eu

for d in 0*; do
( cd $d;
n1=$(awk '/numberOfSubjects:/{print $2}' dandiset.yaml || echo 0 );
n2=$(/bin/ls -1d sub-* 2>/dev/null | wc -l || echo 0);
if [ -n "$n1" ] && [ "$n1" != "$n2" ] ; then
mrp=$(curl --silent -X 'GET' "https://api.dandiarchive.org/api/dandisets/$d/" | jq .most_recent_published_version.version);
echo "`pwd`: Mismatch $n1 != $n2 MRP version: $mrp";
fi
); done

0 comments on commit fddb7fb

Please sign in to comment.