Skip to content

Commit 77e2c04

Browse files
authored
build: add --nonets option, to disable neural network retrieval (#993)
Adds an option for @tongtongcao, to disable `etc/data/nnet` clobbering when running `build-coatjava.sh`.
1 parent 9755d74 commit 77e2c04

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

build-coatjava.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ DATA RETRIEVAL OPTIONS
2020
--lfs use Git Large File Storage (requires `git-lfs`)
2121
--cvmfs use CernVM-FS (requires `/cvfms`)
2222
--xrootd use XRootD (requires `xrootd`)
23-
--nomaps do not download field maps
23+
Options to disable data retrieval:
24+
--nomaps do not download/overwrite field maps
25+
--nonets do not download/overwrite neural networks
2426
2527
TESTING OPTIONS
2628
--spotbugs also run spotbugs plugin
@@ -42,6 +44,7 @@ cleanBuild=false
4244
anaDepends=false
4345
runSpotBugs=false
4446
downloadMaps=true
47+
downloadNets=true
4548
runUnitTests=false
4649
useXrootd=false
4750
useCvmfs=false
@@ -56,6 +59,7 @@ do
5659
--spotbugs) runSpotBugs=true ;;
5760
-n) runSpotBugs=false ;;
5861
--nomaps) downloadMaps=false ;;
62+
--nonets) downloadNets=false ;;
5963
--unittests) runUnitTests=true ;;
6064
--clean) cleanBuild=true ;;
6165
--depana) anaDepends=true ;;
@@ -256,15 +260,17 @@ if $downloadMaps; then
256260
fi
257261

258262
# download neural networks
259-
if $useLfs; then
260-
notify_retrieval 'neural networks' 'lfs'
261-
download_lfs etc/data/nnet
262-
elif $useCvmfs; then
263-
notify_retrieval 'neural networks' 'cvmfs'
264-
cp -r /cvmfs/oasis.opensciencegrid.org/jlab/hallb/clas12/sw/noarch/data/networks/* etc/data/nnet/
265-
else
266-
echo 'WARNING: neural networks not downloaded; run with `--help` for guidance' >&2
267-
sleep 1
263+
if $downloadNets; then
264+
if $useLfs; then
265+
notify_retrieval 'neural networks' 'lfs'
266+
download_lfs etc/data/nnet
267+
elif $useCvmfs; then
268+
notify_retrieval 'neural networks' 'cvmfs'
269+
cp -r /cvmfs/oasis.opensciencegrid.org/jlab/hallb/clas12/sw/noarch/data/networks/* etc/data/nnet/
270+
else
271+
echo 'WARNING: neural networks not downloaded; run with `--help` for guidance' >&2
272+
sleep 1
273+
fi
268274
fi
269275

270276
# download validation data

0 commit comments

Comments
 (0)