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

Casting bound values as float in inference_parameter.py to prevent parsing errors #405

Merged
merged 4 commits into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions flepimop/gempyor_pkg/src/gempyor/inference_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,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=parameter_config["value"]["a"].get(float),
ub=parameter_config["value"]["b"].get(float),
)

# grouped subpop have one parameter per group
Expand All @@ -67,8 +67,8 @@ def add_modifier(self, pname, ptype, parameter_config, subpops):
pname=pname,
subpop=",".join(group),
pdist=parameter_config["value"].as_random_distribution(),
lb=parameter_config["value"]["a"].get(),
ub=parameter_config["value"]["b"].get(),
lb=parameter_config["value"]["a"].get(float),
ub=parameter_config["value"]["b"].get(float),
)
elif parameter_config["method"].get() == "MultiPeriodModifier":
affected_subpops_grp = []
Expand Down Expand Up @@ -97,8 +97,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=parameter_config["value"]["a"].get(float),
ub=parameter_config["value"]["b"].get(float),
)

# grouped subpop have one parameter per group
Expand All @@ -109,8 +109,8 @@ def add_modifier(self, pname, ptype, parameter_config, subpops):
pname=pname,
subpop=",".join(group),
pdist=parameter_config["value"].as_random_distribution(),
lb=parameter_config["value"]["a"].get(),
ub=parameter_config["value"]["b"].get(),
lb=parameter_config["value"]["a"].get(float),
ub=parameter_config["value"]["b"].get(float),
)
else:
raise ValueError(f"Unknown method {parameter_config['method']}")
Expand Down