-
Notifications
You must be signed in to change notification settings - Fork 4
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
Casting bound values as float
in inference_parameter.py
to prevent parsing errors
#405
Conversation
Cast `lb` and `ub` as `floats` when they are pulled from the config.
@@ -53,8 +53,8 @@ def add_modifier(self, pname, ptype, parameter_config, subpops): | |||
pname=pname, | |||
subpop=sp, | |||
pdist=parameter_config["value"].as_random_distribution(), | |||
lb=parameter_config["value"]["a"].get(), | |||
ub=parameter_config["value"]["b"].get(), | |||
lb=float(parameter_config["value"]["a"].get()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason this is of a different form to lines 68 and 69? Otherwise I think this will deal with the error. thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops nope, just fixed them so that they match. Good catch
Two quick things:
|
Describe your changes.
Casting
lb
andub
values as floats within the.add_single_parameter()
method.Does this pull request make any user interface changes? If so please describe.
N/A
What does your pull request address? Tag relevant issues.
This pull request addresses GH #380. Instances of scientific notation in configs that don't have a decimal in the mantissa AND a sign in the exponent are read in as strings (as opposed to floats), and this circumvents that.
Tag relevant team members.
@saraloo , is this adequate enough to prevent parsing errors? Perhaps there is somewhere else in this file (or places in other files) that needs a
float()
cast as well?