brainlife / app-ensembletracking

This App creates a large set of candidate streamlines using an ensemble of algorithms and parameter values. All outputs will be then combined into a single track.tck output.
0 stars 1 forks source link

invalid arithmetic operator #18

Open soichih opened 6 years ago

soichih commented 6 years ago

I saw following error.

WARNING: Could not create bind point file in container /etc/localtime: No such file or directory
./ensembletracking.sh: line 42: 999.977*250000: syntax error: invalid arithmetic operator (error token is ".977*250000")
./ensembletracking.sh: line 61: 50+2500+1000+1000+999.977+12500: syntax error: invalid arithmetic operator (error token is ".977+12500")
=>> PBS: job killed: walltime 50424 exceeded limit 50400

This is probably caused by UI issue which allowed user to enter an invalid fiber count like the following in the config.json

   "num_vz_fibers": 999.993,

I need to implement a better number validator (to force it to be an integer) but until then, can you update the script so that it can handle such case?

bcmcpher commented 6 years ago

bash doesn't handle float numbers at all. It would have to be a bad round w/ something like sed or some sort of fast call to python to not be more trouble than it's worth.

On Wed, Jun 6, 2018 at 7:13 PM, Soichi Hayashi notifications@github.com wrote:

I saw following error.

�[33mWARNING: Could not create bind point file in container /etc/localtime: No such file or directory �[0m./ensembletracking.sh: line 42: 999.977250000: syntax error: invalid arithmetic operator (error token is ".977250000") ./ensembletracking.sh: line 61: 50+2500+1000+1000+999.977+12500: syntax error: invalid arithmetic operator (error token is ".977+12500") =>> PBS: job killed: walltime 50424 exceeded limit 50400

This is probably caused by UI issue which allowed user to enter an invalid fiber count like the following in the config.json

"num_vz_fibers": 999.993,

I need to implement a better number validator (to force it to be an integer) but until then, can you update the script so that it can handle such case?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/brain-life/app-ensembletracking/issues/18, or mute the thread https://github.com/notifications/unsubscribe-auth/ANRr_TKniOsiB9mUytL7ASDvMBNxt6Ivks5t6GIngaJpZM4UdgZE .

soichih commented 6 years ago

@bcmcpher You can just strip below the decimal point like this.

num_vz_fibers=1.23
num_vz_fibers=${num_vz_fibers%.*}
# num_vz_fibers is now just 1

I will implement a validator on the UI side soon.