Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
edoddridge opened this issue May 1, 2017 · 4 comments

Comments

@edoddridge
Copy link
Owner

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
Copy link
Collaborator

axch commented May 5, 2017

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
Copy link
Owner Author

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.

edoddridge added a commit that referenced this issue May 6, 2017
Now that this parameter choice works it should be tested. This is a clone of the beta_plane_gyre test, but with freesurfFac set to 1. Doing this requires an entire directory until #132 is fixed, since freesurfFac can't be altered in the call to `simulate`.
@axch
Copy link
Collaborator

axch commented May 6, 2017

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

@edoddridge
Copy link
Owner Author

That's awkward.

@edoddridge edoddridge changed the title setting slip variable in call to driver.simulate results in an error setting variables to 0 or 1 in call to driver.simulate results in an error Nov 14, 2017
edoddridge added a commit that referenced this issue Nov 14, 2017
As described in #132 parameters can't be set to 0 or 1 in the python wrapper due to numerical/boolean confusion issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants