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

Use core.is_empty instead of np.isnan. Closes #433 #434

Merged
merged 1 commit into from
May 1, 2020
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
10 changes: 5 additions & 5 deletions petab/parameter_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,12 @@ def merge_preeq_and_sim_pars_condition(
par_preeq = condition_map_preeq[par_id]
par_sim = condition_map_sim[par_id]
if par_preeq != par_sim \
and not (np.isnan(par_sim) and np.isnan(par_preeq)):
and not (core.is_empty(par_sim) and core.is_empty(par_preeq)):
# both identical or both nan is okay
if np.isnan(par_sim):
if core.is_empty(par_sim):
# unmapped for simulation
condition_map_sim[par_id] = par_preeq
elif np.isnan(par_preeq):
elif core.is_empty(par_preeq):
# unmapped for preeq is okay
pass
else:
Expand All @@ -540,10 +540,10 @@ def merge_preeq_and_sim_pars_condition(

if scale_preeq != scale_sim:
# both identical is okay
if np.isnan(par_sim):
if core.is_empty(par_sim):
# unmapped for simulation
condition_scale_map_sim[par_id] = scale_preeq
elif np.isnan(par_preeq):
elif core.is_empty(par_preeq):
# unmapped for preeq is okay
pass
else:
Expand Down