edoddridge / aronnax

An idealised isopycnal model that can be run either with n+1/2 layers, or with n layers and variable bathymetry.
http://aronnax.readthedocs.io/en/latest/
MIT License
24 stars 5 forks source link

setting variables to 0 or 1 in call to driver.simulate results in an error #132

Open edoddridge opened 7 years ago

edoddridge commented 7 years ago

Trying to override the value for slip in the config file by passing a new one to driver.simulate results in slip being set to yes for slip=1., or no for slip=0., rather than the numerical value.

Setting it for a partial slip simulation, somewhere in the open interval (0, 1), produces the expected outcome.

axch commented 7 years ago

This presumably has to do with the ConfigParser class trying to be clever somehow about variable types. It must be possible to either persuade it, or post-process. Does the same thing not happen with other variables? Is there anything obviously special about slip?

edoddridge commented 7 years ago

I've just tested freesurfFac and it shows the same behaviour. I suspect other variables would too, but these ones are commonly set to zero or one, and hence we seem to be having numerical/boolean decision errors.

Setting them in the aronnax.conf file seems to be a manageable workaround for now.

axch commented 7 years ago

Stupid Python: python -c 'print 1 == True'. We're probably going to need an explicit workaround for this disaster.

edoddridge commented 7 years ago

That's awkward.